Skip to content

Commit

Permalink
fix: resolve comment
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
  • Loading branch information
JeyJeyGao committed Aug 3, 2023
1 parent a8ba0ff commit edb729c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/encoding/asn1/asn1.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ func decodeLength(r []byte) (int, []byte, error) {
// length must fit the memory space of the int type.
return 0, nil, ErrUnsupportedLength
}
if offset+n >= len(r) {
return 0, nil, ErrEarlyEOF
}
var length uint64
for i := 0; i < n; i++ {
if offset >= len(r) {
return 0, nil, ErrEarlyEOF
}
length = (length << 8) | uint64(r[offset])
offset++
}
Expand Down

0 comments on commit edb729c

Please sign in to comment.