Skip to content

Commit

Permalink
ASN.1: Fix an indefinite length skip error
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
dhowells authored and rustyrussell committed Dec 5, 2012
1 parent 12e130b commit f3537f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/asn1_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static int asn1_find_indefinite_length(const unsigned char *data, size_t datalen

/* Extract the length */
len = data[dp++];
if (len < 0x7f) {
if (len <= 0x7f) {
dp += len;
goto next_tag;
}
Expand Down

0 comments on commit f3537f9

Please sign in to comment.