diff options
author | Ben Kelly <ben@benjii.net> | 2017-02-20 14:04:30 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-02-23 16:52:17 +0100 |
commit | df9e7b1b269f4bd617cd8eb1b8f8a0d9ecb57160 (patch) | |
tree | cfdb5ac9be96e32aee92869971adaa127d5e421b /package | |
parent | 43b6d3f0598e58a9ee200cd6e403e26af865181d (diff) | |
download | upstream-df9e7b1b269f4bd617cd8eb1b8f8a0d9ecb57160.tar.gz upstream-df9e7b1b269f4bd617cd8eb1b8f8a0d9ecb57160.tar.bz2 upstream-df9e7b1b269f4bd617cd8eb1b8f8a0d9ecb57160.zip |
swconfig: Bugfix switch_port uci option parsing
When not defining 'device' or 'vlan' in relevant switch_port uci
sections, behaviour is inconsistent due to *devn, *port and *vlan
pointers not being zero initialized.
Signed-off-by: Ben Kelly <ben@benjii.net>
Diffstat (limited to 'package')
-rw-r--r-- | package/network/config/swconfig/src/uci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/package/network/config/swconfig/src/uci.c b/package/network/config/swconfig/src/uci.c index b541b71646..bf76bd3de1 100644 --- a/package/network/config/swconfig/src/uci.c +++ b/package/network/config/swconfig/src/uci.c @@ -165,7 +165,7 @@ found: s = uci_to_section(e); if (!strcmp(s->type, "switch_port")) { - char *devn, *port, *port_err = NULL; + char *devn = NULL, *port = NULL, *port_err = NULL; int port_n; uci_foreach_element(&s->options, os) { @@ -190,7 +190,7 @@ found: swlib_map_settings(dev, SWLIB_ATTR_GROUP_PORT, port_n, s); } else if (!strcmp(s->type, "switch_vlan")) { - char *devn, *vlan, *vlan_err = NULL; + char *devn = NULL, *vlan = NULL, *vlan_err = NULL; int vlan_n; uci_foreach_element(&s->options, os) { |