[lib] CID #3, fix forward-null errors in vty_prefix_list_uninstall

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.
This commit is contained in:
Paul Jakma 2006-05-12 23:17:38 +00:00
parent ae128056e9
commit 9376c3421a
2 changed files with 12 additions and 0 deletions

View 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

View 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);