diff options
Diffstat (limited to 'src/lib/pid.c')
-rw-r--r-- | src/lib/pid.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/pid.c b/src/lib/pid.c index 5e9b20c94..2e73e85f6 100644 --- a/src/lib/pid.c +++ b/src/lib/pid.c | |||
@@ -197,6 +197,12 @@ static void print_elem(unsigned index, int nowrap) { | |||
197 | char *user = pid_get_user_name(uid); | 197 | char *user = pid_get_user_name(uid); |
198 | char *user_allocated = user; | 198 | char *user_allocated = user; |
199 | 199 | ||
200 | char *cmd_escaped = escape_cntrl_chars(cmd); | ||
201 | if (cmd_escaped) { | ||
202 | free(cmd); | ||
203 | cmd = cmd_escaped; | ||
204 | } | ||
205 | |||
200 | // extract sandbox name - pid == index | 206 | // extract sandbox name - pid == index |
201 | char *sandbox_name = ""; | 207 | char *sandbox_name = ""; |
202 | char *sandbox_name_allocated = NULL; | 208 | char *sandbox_name_allocated = NULL; |
@@ -224,7 +230,15 @@ static void print_elem(unsigned index, int nowrap) { | |||
224 | } | 230 | } |
225 | free(fname); | 231 | free(fname); |
226 | 232 | ||
227 | if (user ==NULL) | 233 | char *sandbox_name_escaped = escape_cntrl_chars(sandbox_name); |
234 | if (sandbox_name_escaped) { | ||
235 | if (sandbox_name_allocated) | ||
236 | free(sandbox_name_allocated); | ||
237 | sandbox_name = sandbox_name_escaped; | ||
238 | sandbox_name_allocated = sandbox_name; | ||
239 | } | ||
240 | |||
241 | if (user == NULL) | ||
228 | user = ""; | 242 | user = ""; |
229 | if (cmd) { | 243 | if (cmd) { |
230 | if (col < 4 || nowrap) | 244 | if (col < 4 || nowrap) |