Commit 397a1b4b by Serge Hallyn Committed by Stéphane Graber

getproctitle - check for null after last strchr

parent 75a8cfbf
...@@ -1596,6 +1596,9 @@ int setproctitle(char *title) ...@@ -1596,6 +1596,9 @@ int setproctitle(char *title)
tmp = strchr(tmp+1, ' '); tmp = strchr(tmp+1, ' ');
} }
if (!tmp)
return -1;
i = sscanf(tmp, "%lu %lu %lu %lu", &arg_start, &arg_end, &env_start, &env_end); i = sscanf(tmp, "%lu %lu %lu %lu", &arg_start, &arg_end, &env_start, &env_end);
if (i != 4) { if (i != 4) {
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment