ASN.1: Fix an indefinite length skip error
authorDavid Howells <dhowells@redhat.com>
Mon, 22 Oct 2012 14:05:55 +0000 (15:05 +0100)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 5 Dec 2012 00:57:39 +0000 (11:27 +1030)
Fix an error in asn1_find_indefinite_length() whereby small definite length
elements of size 0x7f are incorrecly classified as non-small.  Without this
fix, an error will be given as the length of the length will be perceived as
being very much greater than the maximum supported size.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/asn1_decoder.c

index de2c8b5a715bd9c1f75129bc40293ac68f1f92e9..5293d2433029d391c3b95c18320d45c77d117c67 100644 (file)
@@ -91,7 +91,7 @@ next_tag:
 
        /* Extract the length */
        len = data[dp++];
-       if (len < 0x7f) {
+       if (len <= 0x7f) {
                dp += len;
                goto next_tag;
        }