Commit 5ab5ea2
committed
fix: translate RecursionError to StackError in fallback Unpacker.skip()
skip() was the only unpack entry point in fallback.py that let a
RecursionError escape on deeply nested input; unpack() and __next__()
both re-raise it as StackError, and the C extension raises StackError
on this path too. Callers guarding against adversarial nesting with
except StackError/ValueError were unprotected when skipping.
Wrap the body the same way unpack() does, leaving _consume() outside
the try so the post-failure buffer state matches.1 parent 9f9bdae commit 5ab5ea2
2 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
585 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
586 | 589 | | |
587 | 590 | | |
588 | 591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
0 commit comments