Commit 088e58c
committed
stdlib: Escape C1 control characters in bwrite_string unicode path
string_bin_escape_unicode/6 passed all bytes > 127 through without
checking for C1 control characters (U+0080-U+009F). These encode
as 0xC2 0x80-0x9F in UTF-8 and could enable terminal control
injection when rendering untrusted strings.
Fix by matching the specific two-byte C1 sequences and octal-escaping
them, consistent with the list-based write_string path.1 parent f8d1d80 commit 088e58c
2 files changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1087 | 1103 | | |
1088 | 1104 | | |
1089 | 1105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2260 | 2260 | | |
2261 | 2261 | | |
2262 | 2262 | | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
2263 | 2275 | | |
2264 | 2276 | | |
2265 | 2277 | | |
| |||
0 commit comments