jsoninfo: fix a crash when there are no gateways
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 19 Jun 2015 16:12:04 +0000 (18:12 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 19 Jun 2015 16:16:19 +0000 (18:16 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index 5f6e437..7bb9d86 100644 (file)
@@ -871,7 +871,7 @@ static void sgw_ipvx(struct autobuf *abuf, bool ipv6) {
       struct ipaddr_str tunnelGwStr;
       const char * tunnelGw;
 
-      struct gateway_entry * gw = node->gw;
+      struct gateway_entry * gw = node ? node->gw : NULL;
       struct tc_entry* tc;
 
       if (!gw) {