diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-12-04 20:07:02 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-12-04 20:07:02 +0100 |
commit | 581c0d568f6fa7348a164077d761a04d0bb2b4e8 (patch) | |
tree | a0fda7a4eb970c169519474dff2f02b49bbd8b56 /config.c | |
parent | e8714a2ef87d0741ca05e2ef30158452f30fed17 (diff) |
fix use-after-free on config reload
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -176,6 +176,14 @@ config_parse_interface(struct uci_section *s) 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; |