From: Felix Fietkau Date: Sat, 23 Feb 2013 18:30:01 +0000 (+0100) Subject: initialize dest in cmd_add_string() to not segfault on empty strings X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=f39921669076a5f37c05737452d74017dbaa0e23;hp=17d2e4f47b29692d26c243a8d05987e5e5f53b43 initialize dest in cmd_add_string() to not segfault on empty strings --- 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;