From: Zdenek Dohnal Date: Fri, 26 Apr 2024 09:01:18 +0000 (+0200) Subject: Validate input OID for _cupsSNMPString X-Git-Tag: v2.4.8~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66a8e47be2885e9809db9031e3b6966c71c5e338;p=thirdparty%2Fcups.git Validate input OID for _cupsSNMPString --- diff --git a/cups/snmp.c b/cups/snmp.c index 88d5c18504..54e348f1e0 100644 --- a/cups/snmp.c +++ b/cups/snmp.c @@ -509,13 +509,18 @@ _cupsSNMPStringToOID(const char *src, /* I - OID string */ *src && dstptr < dstend; src ++) { - if (*src == '.') + if (*src == '.' && src[1]) { dstptr ++; *dstptr = 0; } else if (isdigit(*src & 255)) + { + if ((*dstptr * 10 + *src - '0') > 0xffff) + break; + *dstptr = *dstptr * 10 + *src - '0'; + } else break; }