From: Felix Fietkau Date: Wed, 20 Feb 2013 17:46:08 +0000 (+0100) Subject: hotplug-rule: fix off-by-one error in blobmsg string buffer realloc X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9f81efba3e70526d7ad15510192ad42b968240c8;p=oweals%2Fprocd.git hotplug-rule: fix off-by-one error in blobmsg string buffer realloc Signed-off-by: Felix Fietkau --- diff --git a/hotplug-rule.c b/hotplug-rule.c index b157fcd..b90ae52 100644 --- a/hotplug-rule.c +++ b/hotplug-rule.c @@ -354,7 +354,7 @@ static void cmd_add_string(const char *pattern, struct blob_attr *msg) } if (cur_len) { - dest = blobmsg_realloc_string_buffer(&b, cur_len); + dest = blobmsg_realloc_string_buffer(&b, cur_len + 1); memcpy(dest + len, cur, cur_len); len += cur_len; }