Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Commita75953b
committed
If the error handler is used, a new bytes object is created to set asthe object attribute of UnicodeDecodeError, and that bytes object thenreplaces the original data. A pointer to the decoded data will became invalidafter destroying that temporary bytes object. So we need other way to returnthe first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal()._PyBytes_DecodeEscape() does not have such issue, because it does notuse the error handlers registry, but it should be changed for compatibilitywith _PyUnicode_DecodeUnicodeEscapeInternal().(cherry picked from commit9f69a58)(cherry picked from commit6279eb8)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent310cd89 commita75953b
File tree
8 files changed
+194
-57
lines changed- Include/cpython
- Lib/test
- Misc/NEWS.d/next/Security
- Objects
- Parser
8 files changed
+194
-57
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 |
| |
29 | 33 |
| |
30 | 34 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
684 | 684 |
| |
685 | 685 |
| |
686 | 686 |
| |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
687 | 700 |
| |
688 | 701 |
| |
689 | 702 |
| |
|
Lines changed: 38 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
| 4 | + | |
4 | 5 |
| |
5 | 6 |
| |
6 | 7 |
| |
| |||
1124 | 1125 |
| |
1125 | 1126 |
| |
1126 | 1127 |
| |
1127 |
| - | |
| 1128 | + | |
1128 | 1129 |
| |
1129 | 1130 |
| |
1130 | 1131 |
| |
| |||
1159 | 1160 |
| |
1160 | 1161 |
| |
1161 | 1162 |
| |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
1162 | 1199 |
| |
1163 | 1200 |
| |
1164 | 1201 |
| |
|
Lines changed: 42 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1196 | 1196 |
| |
1197 | 1197 |
| |
1198 | 1198 |
| |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
1199 | 1203 |
| |
1200 | 1204 |
| |
1201 | 1205 |
| |
1202 |
| - | |
| 1206 | + | |
| 1207 | + | |
1203 | 1208 |
| |
1204 |
| - | |
| 1209 | + | |
| 1210 | + | |
1205 | 1211 |
| |
1206 |
| - | |
| 1212 | + | |
| 1213 | + | |
1207 | 1214 |
| |
1208 | 1215 |
| |
1209 | 1216 |
| |
1210 |
| - | |
| 1217 | + | |
| 1218 | + | |
1211 | 1219 |
| |
1212 | 1220 |
| |
1213 |
| - | |
| 1221 | + | |
| 1222 | + | |
1214 | 1223 |
| |
1215 | 1224 |
| |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1216 | 1232 |
| |
1217 | 1233 |
| |
1218 | 1234 |
| |
| |||
2479 | 2495 |
| |
2480 | 2496 |
| |
2481 | 2497 |
| |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
2482 | 2502 |
| |
2483 | 2503 |
| |
2484 | 2504 |
| |
2485 |
| - | |
| 2505 | + | |
| 2506 | + | |
2486 | 2507 |
| |
2487 | 2508 |
| |
2488 |
| - | |
| 2509 | + | |
| 2510 | + | |
2489 | 2511 |
| |
2490 |
| - | |
| 2512 | + | |
| 2513 | + | |
2491 | 2514 |
| |
2492 | 2515 |
| |
2493 | 2516 |
| |
2494 |
| - | |
| 2517 | + | |
| 2518 | + | |
2495 | 2519 |
| |
2496 | 2520 |
| |
2497 |
| - | |
| 2521 | + | |
| 2522 | + | |
2498 | 2523 |
| |
2499 | 2524 |
| |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
2500 | 2532 |
| |
2501 | 2533 |
| |
2502 | 2534 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + |
Lines changed: 36 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1048 | 1048 |
| |
1049 | 1049 |
| |
1050 | 1050 |
| |
1051 |
| - | |
| 1051 | + | |
1052 | 1052 |
| |
1053 | 1053 |
| |
1054 |
| - | |
| 1054 | + | |
| 1055 | + | |
1055 | 1056 |
| |
1056 | 1057 |
| |
1057 | 1058 |
| |
| |||
1065 | 1066 |
| |
1066 | 1067 |
| |
1067 | 1068 |
| |
1068 |
| - | |
| 1069 | + | |
| 1070 | + | |
1069 | 1071 |
| |
1070 | 1072 |
| |
1071 | 1073 |
| |
| |||
1103 | 1105 |
| |
1104 | 1106 |
| |
1105 | 1107 |
| |
1106 |
| - | |
1107 |
| - | |
1108 |
| - | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1109 | 1112 |
| |
1110 | 1113 |
| |
1111 | 1114 |
| |
| |||
1146 | 1149 |
| |
1147 | 1150 |
| |
1148 | 1151 |
| |
1149 |
| - | |
1150 |
| - | |
1151 |
| - | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1152 | 1156 |
| |
1153 | 1157 |
| |
1154 | 1158 |
| |
| |||
1162 | 1166 |
| |
1163 | 1167 |
| |
1164 | 1168 |
| |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1165 | 1182 |
| |
1166 | 1183 |
| |
1167 | 1184 |
| |
1168 | 1185 |
| |
1169 | 1186 |
| |
1170 | 1187 |
| |
1171 |
| - | |
1172 |
| - | |
1173 |
| - | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
1174 | 1193 |
| |
1175 | 1194 |
| |
1176 |
| - | |
1177 |
| - | |
1178 |
| - | |
| 1195 | + | |
| 1196 | + | |
1179 | 1197 |
| |
1180 |
| - | |
1181 |
| - | |
| 1198 | + | |
| 1199 | + | |
1182 | 1200 |
| |
1183 | 1201 |
| |
1184 | 1202 |
| |
| |||
1187 | 1205 |
| |
1188 | 1206 |
| |
1189 | 1207 |
| |
1190 |
| - | |
| 1208 | + | |
1191 | 1209 |
| |
1192 | 1210 |
| |
1193 | 1211 |
| |
|
0 commit comments
Comments
(0)