get_process_environ: exit early when there is nothing to read
This commit is contained in:
@@ -329,6 +329,9 @@ int get_process_environ(pid_t pid, char **env) {
|
||||
sz += cescape_char(c, outcome + sz);
|
||||
}
|
||||
|
||||
if (sz == 0)
|
||||
return -ENOENT;
|
||||
|
||||
outcome[sz] = '\0';
|
||||
*env = outcome;
|
||||
outcome = NULL;
|
||||
|
||||
Reference in New Issue
Block a user