]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Fix SA issue with stream s read
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 2 Feb 2017 00:43:43 +0000 (19:43 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 2 Feb 2017 00:43:43 +0000 (19:43 -0500)
We were checking for non-null of 'struct stream *s'
after we did a stream_getl, which would have crashed
the program.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/zclient.c

index 92662fd70ffe0b51d8e2c0406e3a5c27112be0bd..cea4b098fc2e135370c0312f4f89adf3c98dfa0f 100644 (file)
@@ -1146,11 +1146,15 @@ struct interface *
 zebra_interface_link_params_read (struct stream *s)
 {
   struct if_link_params *iflp;
-  uint32_t ifindex = stream_getl (s);
+  ifindex_t ifindex;
+
+  assert (s);
+
+  ifindex = stream_getl (s);
 
   struct interface *ifp = if_lookup_by_index (ifindex);
 
-  if (ifp == NULL || s == NULL)
+  if (ifp == NULL)
     {
       zlog_err ("%s: unknown ifindex %u, shouldn't happen",
                 __func__, ifindex);