summaryrefslogtreecommitdiffhomepage
path: root/ubus.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-04-19 11:58:16 +0200
committerFelix Fietkau <nbd@openwrt.org>2014-04-19 11:58:16 +0200
commitede9739fe90f5da09f14481d10a4f11c000072de (patch)
tree8824192949371b8974a448d2e3b9d1c5b9cb4cb9 /ubus.c
parentf06565ce63414c9a1ce558a5ea35f2b6a4ed1605 (diff)
ubus: check the l3_dev pointer before dereferencing it
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ubus.c b/ubus.c
index 5cb54b1..aeb864f 100644
--- a/ubus.c
+++ b/ubus.c
@@ -650,7 +650,8 @@ netifd_dump_status(struct interface *iface)
if (iface->state == IFS_UP) {
time_t cur = system_get_rtime();
blobmsg_add_u32(&b, "uptime", cur - iface->start_time);
- blobmsg_add_string(&b, "l3_device", iface->l3_dev.dev->ifname);
+ if (iface->l3_dev.dev)
+ blobmsg_add_string(&b, "l3_device", iface->l3_dev.dev->ifname);
}
if (iface->proto_handler)