mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user