From: Nikita Kalyazin Date: Tue, 20 Aug 2013 05:42:34 +0000 (+0400) Subject: [FIX] wrong app arguments strip X-Git-Tag: Tizen_SDK_2.3~194 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3affbebbcdea73856053d302486ddcc3759c3029;p=platform%2Fcore%2Fsystem%2Fswap-manager.git [FIX] wrong app arguments strip Fix for 40fa9c37f665eb60442bf53ae5730f17ef6cda98. If there are no arguments, invalid app path is returned. --- diff --git a/daemon/da_protocol.c b/daemon/da_protocol.c index a670995..f6f88ef 100644 --- a/daemon/da_protocol.c +++ b/daemon/da_protocol.c @@ -259,10 +259,14 @@ static int parse_int64(struct msg_buf_t *msg, uint64_t *val) static void strip_args(const char *cmd, char *path) { char *bin_end = strchr(cmd, ' '); - size_t binname_len = bin_end - cmd; - memcpy(path, cmd, binname_len); - path[binname_len] = '\0'; + if (!bin_end) { + strcpy(path, cmd); + } else { + size_t binname_len = bin_end - cmd; + memcpy(path, cmd, binname_len); + path[binname_len] = '\0'; + } } static int parse_app_info(struct msg_buf_t *msg,