fib: fix coverity warning/don't dereference NULL 51/34251/3
authorKlement Sekera <ksekera@cisco.com>
Tue, 26 Oct 2021 14:23:11 +0000 (16:23 +0200)
committerNeale Ranns <neale@graphiant.com>
Tue, 7 Dec 2021 14:54:57 +0000 (14:54 +0000)
fib_sas6_get is called with NULL dst explicitly so add a NULL check to
avoid a NULL dereference.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I8ebcba98832f374991f5442c1b83a4b6e64771d0

src/vnet/fib/fib_sas.c

index 8abac86..c9d4693 100644 (file)
@@ -112,7 +112,7 @@ fib_sas6_get (u32 sw_if_index,
     /*
      * if the dst is v6 and link local, use the source link local
      */
-    if (ip6_address_is_link_local_unicast (dst))
+    if (dst && ip6_address_is_link_local_unicast (dst))
     {
         const ip6_address_t *ll = ip6_get_link_local_address (sw_if_index);
         if (NULL == ll)