Skip to content

Commit

Permalink
Prevent reading past the closing tag of a cov subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
Discolai committed Apr 14, 2024
1 parent 96b580d commit 52c1209
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Serialize/ASN1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,7 @@ public static int decode_cov_subscription(byte[] buffer, int offset, int apduLen
return -1;
len += decode_unsigned(buffer, offset + len, lenValueType, out value.TimeRemaining);

if (len < apduLen && IS_OPENING_TAG(buffer[offset + len]))
if (len < apduLen && !IS_CLOSING_TAG(buffer[offset + len]))
{
decode_tag_number_and_value(buffer, offset + len, out tagNumber, out lenValueType);
if (tagNumber != 4)
Expand Down

0 comments on commit 52c1209

Please sign in to comment.