Skip to content

Commit f3537f9

Browse files
dhowellsrustyrussell
authored andcommitted
ASN.1: Fix an indefinite length skip error
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>
1 parent 12e130b commit f3537f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/asn1_decoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static int asn1_find_indefinite_length(const unsigned char *data, size_t datalen
9191

9292
/* Extract the length */
9393
len = data[dp++];
94-
if (len < 0x7f) {
94+
if (len <= 0x7f) {
9595
dp += len;
9696
goto next_tag;
9797
}

0 commit comments

Comments
 (0)