mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Fix std/cbor src.meta.ri for too much recursion
Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25145
This commit is contained in:
1 parent
75682548f5
commit
75e1efcc4a
2 files changed
+20
No files matched your search
@@ -456,6 +456,11 @@ pub func decoder.decode_tokens?(dst: base.token_writer, src: base.io_reader, wor
|
||||
if TOKEN_LENGTHS[c_minor] == 0 {
|
||||
break.goto_fail
|
||||
} else if depth >= 1024 {
|
||||
token_length = TOKEN_LENGTHS[c_minor] as base.u32
|
||||
while (token_length > 0) and (args.src.can_undo_byte()) {
|
||||
args.src.undo_byte!()
|
||||
token_length -= 1
|
||||
} endwhile
|
||||
return "#unsupported recursion depth"
|
||||
}
|
||||
|
||||
@@ -518,6 +523,11 @@ pub func decoder.decode_tokens?(dst: base.token_writer, src: base.io_reader, wor
|
||||
if TOKEN_LENGTHS[c_minor] == 0 {
|
||||
break.goto_fail
|
||||
} else if depth >= 1024 {
|
||||
token_length = TOKEN_LENGTHS[c_minor] as base.u32
|
||||
while (token_length > 0) and (args.src.can_undo_byte()) {
|
||||
args.src.undo_byte!()
|
||||
token_length -= 1
|
||||
} endwhile
|
||||
return "#unsupported recursion depth"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user