1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-30 08:19:09 +00:00

Avoid indexing an array with a negative value.

Reported by:	Coverity
CID:		971121
This commit is contained in:
Don Lewis 2016-05-13 00:58:05 +00:00
parent 16a9eab953
commit a5f637460b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299583

View File

@ -726,7 +726,7 @@ ber_scanf_elements(struct ber_element *ber, char *fmt, ...)
continue;
case '}':
case ')':
if (parent[level] == NULL)
if (level < 0 || parent[level] == NULL)
goto fail;
ber = parent[level--];
ret++;