Commit 8d1359f
committed
gh-148252: Fix stack depth calculation in binary reader on 32-bit platforms
Compute ``final_depth`` in ``decode_stack_pop_push()`` and
``decode_stack_suffix()`` using ``uint64_t`` before validating it.
On 32-bit builds, using ``size_t`` arithmetic for ``keep + push`` can wrap
for large input values, causing the later bounds check to validate the wrong
final depth. Using a widened type keeps the validation aligned with the
actual result.1 parent acf5229 commit 8d1359f
File tree
2 files changed
+23
-12
lines changed- Misc/NEWS.d/next/Security
- Modules/_remote_debugging
2 files changed
+23
-12
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
604 | 618 | | |
605 | 619 | | |
606 | 620 | | |
| |||
658 | 672 | | |
659 | 673 | | |
660 | 674 | | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
667 | 678 | | |
668 | 679 | | |
669 | 680 | | |
| |||
713 | 724 | | |
714 | 725 | | |
715 | 726 | | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
722 | 730 | | |
723 | 731 | | |
724 | 732 | | |
| |||
0 commit comments