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

index 1587367..356e1e0 100644 (file)
@@ -558,7 +558,7 @@ static void sgw_ipvx(struct autobuf *abuf, bool ipv6, const char * fmth, const c
       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) {