projects
/
platform
/
core
/
system
/
swap-manager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
34aed4a
)
[FIX] wrong app arguments strip
author
Nikita Kalyazin
<n.kalyazin@samsung.com>
Tue, 20 Aug 2013 05:42:34 +0000
(09:42 +0400)
committer
Nikita Kalyazin
<n.kalyazin@samsung.com>
Tue, 20 Aug 2013 05:42:34 +0000
(09:42 +0400)
Fix for
40fa9c37f665eb60442bf53ae5730f17ef6cda98
.
If there are no arguments, invalid app path is returned.
daemon/da_protocol.c
patch
|
blob
|
history
diff --git
a/daemon/da_protocol.c
b/daemon/da_protocol.c
index
a670995
..
f6f88ef
100644
(file)
--- 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,