There are about 14 places where sprintf is use throughout system_stats codebase. The issue is that there's potential for buffer overrun and the suggestion is to use snprintf
Here's one example:
sprintf(cpu_desc, "%s model %s family %s", vendor_id, model, cpu_family);
The above snipped could be changed to:
snprintf(cpu_desc, MAXPGPATH, "%s model %s family %s", vendor_id, model, cpu_family);
This has actually been done in some other places. It would be good to complete this work.
There are about 14 places where sprintf is use throughout system_stats codebase. The issue is that there's potential for buffer overrun and the suggestion is to use snprintf
Here's one example:
sprintf(cpu_desc, "%s model %s family %s", vendor_id, model, cpu_family);
The above snipped could be changed to:
snprintf(cpu_desc, MAXPGPATH, "%s model %s family %s", vendor_id, model, cpu_family);
This has actually been done in some other places. It would be good to complete this work.