Skip to content

Commit

Permalink
FIX: allow incomplete tag in DER codec (because it looks it can happen)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jun 8, 2020
1 parent 38b90d0 commit 6238d23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mezz/codec-der.r
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ register-codec [
insert tails (data-pos + length)
][
;- primitive
;print ["tag:" tag-name "len: " length length? der/buffer]
if length > length? der/buffer [
print "Tag length expects more bytes than available!"
length: length? der/buffer
]
binary/read der [data: BYTES :length]
switch tag-name [
OBJECT_IDENTIFIER [
Expand Down

0 comments on commit 6238d23

Please sign in to comment.