Commit 637b954
committed
fix(input): bail OSC code accumulation past 22 to prevent overflow
The numeric OSC code loop accumulated digits with no cap, so a long
digit run (e.g. ESC ] 9999...) would overflow the int accumulator.
Since 22 is the only code parse_osc accepts and the accumulator only
grows, bail with PARSE_ERR as soon as it passes 22.
Addresses review feedback from @dreyfus92 on #101.1 parent 4b618f3 commit 637b954
2 files changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
635 | 640 | | |
636 | 641 | | |
637 | 642 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
766 | 775 | | |
767 | 776 | | |
768 | 777 | | |
| |||
0 commit comments