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.librecmc.org/?a=commitdiff_plain;h=f39921669076a5f37c05737452d74017dbaa0e23;p=oweals%2Fprocd.git 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;