]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Validate input OID for _cupsSNMPString
authorZdenek Dohnal <zdohnal@redhat.com>
Fri, 26 Apr 2024 09:01:18 +0000 (11:01 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Fri, 26 Apr 2024 09:01:18 +0000 (11:01 +0200)
cups/snmp.c

index 88d5c185049143fd9f6f067c29ed0a80547a9455..54e348f1e0d88c5a131664e46973feff9c4c2d65 100644 (file)
@@ -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;
   }