]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
authorAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 19 Jun 2008 05:37:04 +0000 (23:37 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 19 Jun 2008 05:37:04 +0000 (23:37 -0600)
Reject ridiculously large ASN.1 lengths

snmplib/asn1.c

index 5ad7d7515b94c67c224f1564d842e36323c1209f..e0dde7fb78b3adf556cea8ffeec41243bae53f6f 100644 (file)
@@ -484,7 +484,7 @@ asn_parse_header(u_char * data, int *datalength, u_char * type)
        return (NULL);
 
     header_len = bufp - data;
-    if (header_len + asn_length > *datalength) {
+    if (header_len + asn_length > *datalength || asn_length > (u_int)(2 << 18) ) {
        snmp_set_api_error(SNMPERR_ASN_DECODE);
        return (NULL);
     }