]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix a potential SNMP OID value overflow issue (Issue #431)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 18 Jul 2022 22:03:49 +0000 (18:03 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 18 Jul 2022 22:03:49 +0000 (18:03 -0400)
CHANGES.md
cups/snmp.c

index 11b5fd0732ca0487ff9f00a6328c0f304ce429df..b63e9d014b38769a328dff91df4c5db6267fedc5 100644 (file)
@@ -9,6 +9,7 @@ Changes in CUPS v2.4.3 (TBA)
 - Fixed the `device_uri` invalid pointer for driverless printers with `.local`
   hostname (Issue #419)
 - Fixed an OpenSSL crash bug (Issue #409)
+- Fixed a potential SNMP OID value overflow issue (Issue #431)
 - Use localhost when printing via printer application (Issue #353)
 - Now localize HTTP responses using the Content-Language value (Issue #426)
 
index 6da119d7679d6c37863f8954e4fb7d18e0767d17..f2e0ee1bbd1f4a05aed5e2c61639d01fd5fa7db3 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * SNMP functions for CUPS.
  *
+ * Copyright © 2022 by OpenPrinting.
  * Copyright © 2007-2019 by Apple Inc.
  * Copyright © 2006-2007 by Easy Software Products, all rights reserved.
  *
@@ -1272,7 +1273,6 @@ asn1_get_length(unsigned char **buffer,   /* IO - Pointer in buffer */
   {
     int        count;                          /* Number of bytes for length */
 
-
     if ((count = length & 127) > sizeof(unsigned))
     {
       (*buffer) += count;
@@ -1317,7 +1317,7 @@ asn1_get_oid(
   if (valend > bufend)
     valend = bufend;
 
-  number = asn1_get_packed(buffer, bufend);
+  number = asn1_get_packed(buffer, valend);
 
   if (number < 80)
   {
@@ -1334,7 +1334,7 @@ asn1_get_oid(
 
   while (*buffer < valend)
   {
-    number = asn1_get_packed(buffer, bufend);
+    number = asn1_get_packed(buffer, valend);
 
     if (oidptr < oidend)
       *oidptr++ = number;