From f39921669076a5f37c05737452d74017dbaa0e23 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 23 Feb 2013 19:30:01 +0100 Subject: initialize dest in cmd_add_string() to not segfault on empty strings --- hotplug-rule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3