projects
/
openwrt
/
staging
/
svanheule.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43b6d3f
)
swconfig: Bugfix switch_port uci option parsing
author
Ben Kelly
<ben@benjii.net>
Mon, 20 Feb 2017 12:04:30 +0000
(14:04 +0200)
committer
Felix Fietkau
<nbd@nbd.name>
Thu, 23 Feb 2017 15:52:17 +0000
(16:52 +0100)
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>
package/network/config/swconfig/src/uci.c
patch
|
blob
|
history
diff --git
a/package/network/config/swconfig/src/uci.c
b/package/network/config/swconfig/src/uci.c
index b541b71646e0d70023d6955cae4136a6cbe2024b..bf76bd3de1d3e1c5c906e410d3e13125529522fc 100644
(file)
--- 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) {