]> git.puffer.fish Git - mirror/frr.git/commitdiff
[lib] CID #3, fix forward-null errors in vty_prefix_list_uninstall
authorPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:17:38 +0000 (23:17 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:17:38 +0000 (23:17 +0000)
2006-05-12 Paul Jakma <paul.jakma@sun.com>

* plist.c: (vty_prefix_list_uninstall) Fix potential NULL deref
  of prefix and typestr strings, Coverity CID #3.

lib/ChangeLog
lib/plist.c

index 9e6dc852200e2556ea2c604b3bd52dc9f7fb7110..64fa8518adba760ee9aad2b1bf90684405db2488 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-12 Paul Jakma <paul.jakma@sun.com>
+
+       * plist.c: (vty_prefix_list_uninstall) Fix potential NULL deref
+         of prefix and typestr strings, Coverity CID #3.
+
 2006-03-30 Paul Jakma <paul.jakma@sun.com>
 
        * command.h: (DEFUN_CMD_FUNC_TEXT) Annotate arguments as
index 83c5aa0c7188d255a38e6d648caf3ce230a3cf53..6caece0e36752a4b236bea9c2cb547cf551f9191 100644 (file)
@@ -804,6 +804,13 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
       return CMD_SUCCESS;
     }
 
+  /* We must have, at a minimum, both the type and prefix here */
+  if ((typestr == NULL) || (prefix == NULL))
+    {
+      vty_out (vty, "%% Both prefix and type required%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
   /* Check sequence number. */
   if (seq)
     seqnum = atoi (seq);