lq: make sure last_ip != NULL
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 12:45:29 +0000 (14:45 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 12:49:41 +0000 (14:49 +0200)
Coverity:
CID 739653 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
At (11): Passing null pointer "last_ip" to function
         "calculate_border_flag(void *, void *)", which dereferences it.

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

index efb5018..e20325c 100644 (file)
@@ -574,6 +574,7 @@ serialize_lq_tc(struct lq_tc_message *lq_tc, struct interface *outif)
     // force signed comparison
     if ((int)(size + olsr_cnf->ipsize + olsr_sizeof_tc_lqdata()) > rem) {
       head->lower_border = left_border_flag;
+      assert(last_ip);
       head->upper_border = calculate_border_flag(last_ip, &neigh->address);
       left_border_flag = head->upper_border;