[OpenWrt-Devel] [PATCH netifd 04/16] tunnel: Fix uninitialized access

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


Fix tb_dev uninitialized access by device_init_settings

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

diff --git a/tunnel.c b/tunnel.c
index aa670a3..524fd43 100644
--- a/tunnel.c
+++ b/tunnel.c
@@ -49,12 +49,11 @@ tunnel_reload(struct device *dev, struct blob_attr *attr)
 	if (uci_blob_check_equal(dev->config, attr, cfg))
 		return DEV_CONFIG_NO_CHANGE;
 
-	if (attr) {
-		memset(tb_dev, 0, sizeof(tb_dev));
+	memset(tb_dev, 0, sizeof(tb_dev));
 
+	if (attr)
 		blobmsg_parse(device_attr_list.params, __DEV_ATTR_MAX, tb_dev,
 			blob_data(attr), blob_len(attr));
-	}
 
 	device_init_settings(dev, tb_dev);
 
-- 
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