Skip to content

Commit a151d26

Browse files
committed
fixed #25
Related Work Items: #2, #25
1 parent 35fe7fc commit a151d26

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Asn1Parser/Asn1Utils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static ReadOnlyMemory<Byte> GetLengthBytesAsMemory(Int32 payloadLength) {
5858
/// <summary>
5959
/// Calculates the ASN.1 payload length from a given ASN.1 length header.
6060
/// </summary>
61-
/// <param name="asnHeader">A byte array that represents ASN.1 length header</param>
61+
/// <param name="asnHeader">A byte array that represents ASN.1 length header excluding tag and payload.</param>
6262
/// <exception cref="OverflowException">
6363
/// <strong>asnHeader</strong> parameter length is more than 4 bytes or is invalid value.
6464
/// </exception>
@@ -67,7 +67,7 @@ public static Int64 CalculatePayloadLength(ReadOnlySpan<Byte> asnHeader) {
6767
if (asnHeader.Length == 0) {
6868
return 0;
6969
}
70-
if (asnHeader[0] < 127) {
70+
if (asnHeader[0] <= 127) {
7171
return asnHeader[0];
7272
}
7373
Int32 lengthBytes = asnHeader[0] - 128;

0 commit comments

Comments
 (0)