[OpenWrt-Devel] [PATCH netifd 03/16] ubus: Fix possible segfault

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


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

diff --git a/ubus.c b/ubus.c
index 454b42d..4184301 100644
--- a/ubus.c
+++ b/ubus.c
@@ -969,6 +969,9 @@ static void netifd_add_iface_object(void)
 	int i;
 
 	methods = calloc(1, sizeof(iface_object_methods));
+	if (!methods)
+		return;
+
 	memcpy(methods, iface_object_methods, sizeof(iface_object_methods));
 	iface_object.methods = methods;
 
-- 
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