bmf: do not dereference NULL pointer
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 22 Oct 2012 13:29:15 +0000 (15:29 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 22 Oct 2012 13:33:15 +0000 (15:33 +0200)
Coverity:
CID 739667 (#1 of 1): Dereference null return value (NULL_RETURNS)
At (31): Dereferencing a null pointer "bestIntf".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/bmf/src/NetworkInterfaces.c

index 295b49b..9c69bab 100644 (file)
@@ -861,7 +861,7 @@ void FindNeighbors(
             "%s: ----> not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %s\n",
             PLUGIN_NAME_SHORT,
             olsr_ip_to_string(&buf, &walker->neighbor_iface_addr),
-            bestIntf->int_name,
+            bestIntf ? bestIntf->int_name : "NULL",
             get_linkcost_text(bestLinkToNeighbor->linkcost, false, &lqbuffer));
         }