[OpenWrt-Devel] [PATCH netifd 14/16] alias: Fix possible segfault

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


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

diff --git a/alias.c b/alias.c
index 01bec41..1f23da0 100644
--- a/alias.c
+++ b/alias.c
@@ -112,6 +112,9 @@ alias_device_create(const char *name, struct blob_attr *attr)
 	struct alias_device *alias;
 
 	alias = calloc(1, sizeof(*alias) + strlen(name) + 1);
+	if (!alias)
+		return NULL;
+
 	strcpy(alias->name, name);
 	alias->dev.set_state = alias_device_set_state;
 	alias->dev.hidden = true;
-- 
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