summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-02-23 19:30:01 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-02-23 19:30:01 +0100
commitf39921669076a5f37c05737452d74017dbaa0e23 (patch)
treeeb3a8019f9f0b584365b2c007813c454643bfa7c
parent17d2e4f47b29692d26c243a8d05987e5e5f53b43 (diff)
downloadunitd-f39921669076a5f37c05737452d74017dbaa0e23.tar
unitd-f39921669076a5f37c05737452d74017dbaa0e23.zip
initialize dest in cmd_add_string() to not segfault on empty strings
-rw-r--r--hotplug-rule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hotplug-rule.c b/hotplug-rule.c
index cb31c3f..1f3189d 100644
--- a/hotplug-rule.c
+++ b/hotplug-rule.c
@@ -325,7 +325,7 @@ static void cmd_add_string(const char *pattern, struct blob_attr *msg)
int len = 0;
bool var = false;
- blobmsg_alloc_string_buffer(&b, NULL, 1);
+ dest = blobmsg_alloc_string_buffer(&b, NULL, 1);
str = alloca(strlen(pattern) + 1);
strcpy(str, pattern);
next = str;