From: Rosen Penev Date: Mon, 25 Dec 2017 22:52:20 +0000 (-0800) Subject: procd: Fix minor null pointer dereference. X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6900a6be63c63707c304cfe79c7469725fd07c11;p=oweals%2Fprocd.git procd: Fix minor null pointer dereference. Null pointer check was placed after assigning values to c. Signed-off-by: Rosen Penev --- diff --git a/plug/hotplug.c b/plug/hotplug.c index 9fc1938..0905e4e 100644 --- a/plug/hotplug.c +++ b/plug/hotplug.c @@ -392,12 +392,12 @@ static void queue_add(struct cmd_handler *h, struct blob_attr *msg, struct blob_ &_data, blob_pad_len(data), NULL); - c->msg = _msg; - c->data = _data; - if (!c) return; + c->msg = _msg; + c->data = _data; + memcpy(c->msg, msg, blob_pad_len(msg)); memcpy(c->data, data, blob_pad_len(data)); c->handler = h->handler;