mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
Have std/cbor reject nested indefinite-len strings
This commit is contained in:
1 parent
c0ffa2a2d5
commit
1d89fd5915
2 files changed
+12
No files matched your search
@@ -248,6 +248,9 @@ pub func decoder.decode_tokens?(dst: base.token_writer, src: base.io_reader, wor
|
||||
continued: 1,
|
||||
length: TOKEN_LENGTHS[c_minor] as base.u32)
|
||||
} else if c_minor == 0x1F {
|
||||
if indefinite_string_major_type <> 0 {
|
||||
break.goto_fail
|
||||
}
|
||||
indefinite_string_major_type = 2
|
||||
args.dst.write_simple_token_fast!(
|
||||
value_major: 0,
|
||||
@@ -324,6 +327,9 @@ pub func decoder.decode_tokens?(dst: base.token_writer, src: base.io_reader, wor
|
||||
continued: 1,
|
||||
length: TOKEN_LENGTHS[c_minor] as base.u32)
|
||||
} else if c_minor == 0x1F {
|
||||
if indefinite_string_major_type <> 0 {
|
||||
break.goto_fail
|
||||
}
|
||||
indefinite_string_major_type = 3
|
||||
args.dst.write_simple_token_fast!(
|
||||
value_major: 0,
|
||||
|
||||
Reference in new issue
Block a user