Security review: check results of snprintf.

Calls marked with xSnprintf shouldn't fail.
Abort program cleanly if any of them does.
This commit is contained in:
Hisham Muhammad
2017-07-27 16:07:50 -03:00
parent 3975e9ce5c
commit 09e241fb12
25 changed files with 125 additions and 120 deletions

View File

@ -215,7 +215,7 @@ void Platform_setSwapValues(Meter* this) {
char* Platform_getProcessEnv(pid_t pid) {
char procname[32+1];
snprintf(procname, 32, "/proc/%d/environ", pid);
xSnprintf(procname, 32, "/proc/%d/environ", pid);
FILE* fd = fopen(procname, "r");
char *env = NULL;
if (fd) {