[OpenWrt-Devel] [PATCH netifd 08/16] interface: Fix possbile segfault

Hans Dedecker dedeckeh at gmail.com
Mon Feb 1 04:56:22 EST 2016


Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 interface.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/interface.c b/interface.c
index 2aab37c..7b18cef 100644
--- a/interface.c
+++ b/interface.c
@@ -189,6 +189,9 @@ interface_add_data(struct interface *iface, const struct blob_attr *data)
 	}
 
 	n = calloc(1, sizeof(*n) + len);
+	if (!n)
+		return UBUS_STATUS_UNKNOWN_ERROR;
+
 	memcpy(n->data, data, len);
 	n->node.key = blobmsg_name(n->data);
 	avl_insert(&iface->data, &n->node);
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list