From: Rafał Miłecki Date: Fri, 13 Dec 2019 10:05:11 +0000 (+0100) Subject: blockd: fix vlist memory corruption X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5ea47fe35e5db7b231393d21515daeaef9da8498;p=project%2Ffstools.git blockd: fix vlist memory corruption vlist_add() expects key to point a persistent memory as it doesn't make its copy. Passing blob_attr of current message was resulting in undefined/random behavior including list corruption and possible crashes. Signed-off-by: Rafał Miłecki --- diff --git a/blockd.c b/blockd.c index 88fe168..7375b2b 100644 --- a/blockd.c +++ b/blockd.c @@ -255,7 +255,7 @@ block_hotplug(struct ubus_context *ctx, struct ubus_object *obj, strcpy(_name, devname); device->target = __target; strcpy(__target, target); - vlist_add(&devices, &device->node, blobmsg_get_string(data[MOUNT_DEVICE])); + vlist_add(&devices, &device->node, device->name); } vlist_flush(&devices);