Get rid of a NULL dereference when oid is too long.

Reviewed by:	keramida
Approved by:	grehan (mentor)
MFC after:	1 week
This commit is contained in:
Suleiman Souhlal 2005-01-25 14:37:43 +00:00
parent e80dde60e3
commit 1d4961c06f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140818

View File

@ -169,7 +169,8 @@ parse(char *string)
u_int kind;
bufp = buf;
snprintf(buf, BUFSIZ, "%s", string);
if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ)
errx(1, "oid too long: '%s'", string);
if ((cp = strchr(string, '=')) != NULL) {
*strchr(buf, '=') = '\0';
*cp++ = '\0';