sgw: harden isGwSelectable function
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 26 May 2016 22:48:40 +0000 (00:48 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 26 May 2016 23:39:57 +0000 (01:39 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/gateway_default_handler.h

index 6358433..db59eba 100644 (file)
 #include <stdbool.h>
 
 static INLINE bool isGwSelectable(struct gateway_entry * gw, bool ipv6) {
+  if (!gw) {
+    return false;
+  }
+
   if (!ipv6) {
     return gw->ipv4 //
         && ((olsr_cnf->ip_version == AF_INET) //