Skip to content

Commit 66a8e47

Browse files
committed
Validate input OID for _cupsSNMPString
1 parent 6af8639 commit 66a8e47

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cups/snmp.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,18 @@ _cupsSNMPStringToOID(const char *src, /* I - OID string */
509509
*src && dstptr < dstend;
510510
src ++)
511511
{
512-
if (*src == '.')
512+
if (*src == '.' && src[1])
513513
{
514514
dstptr ++;
515515
*dstptr = 0;
516516
}
517517
else if (isdigit(*src & 255))
518+
{
519+
if ((*dstptr * 10 + *src - '0') > 0xffff)
520+
break;
521+
518522
*dstptr = *dstptr * 10 + *src - '0';
523+
}
519524
else
520525
break;
521526
}

0 commit comments

Comments
 (0)