From 4e5d3217ca213543cbd509b2801e498af03ee09f Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Wed, 31 Aug 2011 22:03:31 +0200 Subject: [PATCH] Copy the string first, since shell_output_str() does not ensure constness of the first string --- apps/shell/shell-ps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/shell/shell-ps.c b/apps/shell/shell-ps.c index c1d6643db..673369515 100644 --- a/apps/shell/shell-ps.c +++ b/apps/shell/shell-ps.c @@ -58,7 +58,9 @@ PROCESS_THREAD(shell_ps_process, ev, data) shell_output_str(&ps_command, "Processes:", ""); for(p = PROCESS_LIST(); p != NULL; p = p->next) { - shell_output_str(&ps_command, PROCESS_NAME_STRING(p), ""); + char namebuf[30]; + strncpy(namebuf, PROCESS_NAME_STRING(p), sizeof(namebuf)); + shell_output_str(&ps_command, namebuf, ""); } PROCESS_END();