Commit 39a5ea1
committed
Strip control / unprintable characters (keeping newline and tab) from the
?cmd= value before running it, so a bare NUL (%00) no longer reaches the
parser and prints a baffling "command not found:" with nothing after it
(#52), and cap the length so an oversized value degrades gracefully instead
of being handed to the WASM runtime wholesale (#53). Adds sanitizeUrlCommand
unit tests.
Also tidies the file so it lints clean: drop the dead promptLen helper and
use an optional catch binding.
1 parent ba9c08e commit 39a5ea1
2 files changed
Lines changed: 60 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
509 | 532 | | |
510 | 533 | | |
511 | 534 | | |
| |||
804 | 827 | | |
805 | 828 | | |
806 | 829 | | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | 830 | | |
814 | 831 | | |
815 | 832 | | |
| |||
1033 | 1050 | | |
1034 | 1051 | | |
1035 | 1052 | | |
1036 | | - | |
| 1053 | + | |
1037 | 1054 | | |
1038 | 1055 | | |
1039 | 1056 | | |
1040 | 1057 | | |
1041 | 1058 | | |
1042 | 1059 | | |
1043 | | - | |
| 1060 | + | |
1044 | 1061 | | |
1045 | 1062 | | |
1046 | 1063 | | |
| |||
1114 | 1131 | | |
1115 | 1132 | | |
1116 | 1133 | | |
| 1134 | + | |
1117 | 1135 | | |
1118 | 1136 | | |
1119 | 1137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
145 | 178 | | |
146 | 179 | | |
147 | 180 | | |
| |||
0 commit comments