projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e8714a2
)
fix use-after-free on config reload
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 4 Dec 2011 19:07:02 +0000
(20:07 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 4 Dec 2011 19:07:02 +0000
(20:07 +0100)
config.c
patch
|
blob
|
history
diff --git
a/config.c
b/config.c
index
fcfea7c
..
8472d44
100644
(file)
--- a/
config.c
+++ b/
config.c
@@
-176,6
+176,14
@@
config_parse_interface(struct uci_section *s)
memcpy(config, b.head, blob_pad_len(b.head));
interface_add(iface, config);
memcpy(config, b.head, blob_pad_len(b.head));
interface_add(iface, config);
+ /*
+ * need to look up the interface name again, in case of config update,
+ * the pointer will have changed
+ */
+ iface = vlist_find(&interfaces, s->e.name, iface, node);
+ if (!iface)
+ return;
+
dev = iface->main_dev.dev;
if (!dev || !dev->default_config)
return;
dev = iface->main_dev.dev;
if (!dev || !dev->default_config)
return;