Serhiy Storchaka
0c33e5baed
[3.11] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944)
...
If the error handler is used, a new bytes object is created to set as
the object attribute of UnicodeDecodeError, and that bytes object then
replaces the original data. A pointer to the decoded data will became invalid
after destroying that temporary bytes object. So we need other way to return
the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal().
_PyBytes_DecodeEscape() does not have such issue, because it does not
use the error handlers registry, but it should be changed for compatibility
with _PyUnicode_DecodeUnicodeEscapeInternal().
(cherry picked from commit 9f69a58623 )
(cherry picked from commit 6279eb8c07 )
(cherry picked from commit a75953b347 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com >
2025-05-20 18:12:29 +03:00
..
2024-07-22 13:44:55 +02:00
2024-03-08 08:27:33 +00:00
2023-09-26 11:21:09 +03:00
2024-02-29 19:48:38 +00:00
2024-02-12 13:45:22 +02:00
2025-04-03 18:27:02 +02:00
2022-11-07 18:57:10 -08:00
2024-02-03 19:38:23 +00:00
2023-02-21 07:52:02 +08:00
2024-09-04 17:50:00 +02:00
2024-02-23 02:38:49 +00:00
2024-03-28 11:17:10 +00:00
2024-02-28 14:08:40 +00:00
2022-05-25 07:24:32 -07:00
2024-03-23 10:19:14 +00:00
2022-04-14 12:50:11 -07:00
2024-02-27 16:14:01 +00:00
2025-04-08 15:15:29 +01:00
2023-10-14 06:51:24 +00:00
2023-08-30 20:12:10 +00:00
2025-05-20 18:12:29 +03:00
2025-02-19 10:51:35 +02:00
2022-03-08 09:26:13 +01:00
2023-10-20 04:25:17 +00:00
2024-03-22 09:48:41 +00:00
2025-02-19 14:13:52 +01:00
2024-11-01 13:11:47 +00:00
2022-09-25 01:20:45 -07:00
2024-03-06 14:17:02 -08:00
2022-03-30 12:00:27 +01:00
2023-10-15 08:32:26 +00:00
2022-07-05 11:16:32 +02:00
2022-03-22 13:53:51 +01:00
2022-04-06 13:03:36 -05:00
2022-02-03 11:20:08 +02:00
2023-12-19 19:57:08 +01:00
2022-04-21 21:27:15 -07:00
2024-02-17 14:55:43 +02:00
2023-12-26 20:09:41 +00:00
2022-04-06 20:00:14 +03:00
2023-04-11 07:19:33 -07:00
2022-04-11 15:02:41 -07:00
2024-02-26 23:14:32 +00:00
2023-09-18 15:11:56 +01:00
2022-04-06 11:22:39 -07:00
2022-04-06 11:22:39 -07:00
2023-04-25 18:08:54 +01:00
2024-01-29 16:41:45 +00:00
2022-04-08 17:15:35 -07:00
2022-04-08 17:15:35 -07:00
2022-04-11 15:02:41 -07:00
2022-05-03 21:36:52 -06:00
2023-09-10 17:41:19 +00:00
2023-10-31 14:41:20 +00:00
2023-07-11 15:48:00 +00:00
2022-12-23 12:43:13 -08:00
2024-03-19 18:19:04 +01:00
2023-10-10 11:12:52 +02:00
2022-06-10 16:00:19 +02:00
2022-04-06 20:00:14 +03:00
2023-04-27 21:23:46 +00:00
2022-08-15 08:37:51 -07:00
2024-03-19 11:57:45 +01:00
2023-09-15 13:29:57 +00:00
2022-04-27 15:28:56 -06:00
2023-10-11 14:48:03 -06:00
2024-02-19 17:54:59 +00:00
2024-03-11 17:36:15 -07:00
2023-02-21 12:39:16 +09:00
2022-06-05 02:39:11 -07:00
2024-01-13 13:22:31 -05:00
2024-01-21 22:31:12 +02:00
2022-06-18 07:41:25 -07:00
2023-10-09 16:10:34 +02:00
2024-02-11 11:04:02 +00:00
2022-04-12 22:46:40 +09:00
2022-03-22 02:37:00 -07:00
2022-04-17 23:12:33 -05:00
2023-12-12 17:17:35 +00:00
2025-02-19 14:16:30 +01:00
2022-04-13 10:47:41 -07:00
2024-03-01 12:55:14 +00:00
2023-11-10 07:32:41 +00:00
2024-12-03 17:57:10 +01:00
2024-02-20 18:18:16 +00:00
2023-10-27 16:08:53 +03:00
2024-02-06 19:16:54 +00:00
2022-06-03 08:25:58 -07:00
2024-03-26 11:46:28 +00:00
2022-04-15 12:32:56 -07:00
2023-08-22 15:35:16 +01:00
2022-09-08 12:03:53 +01:00
2022-06-28 16:30:22 +01:00
2024-03-13 10:03:17 +00:00
2023-05-10 23:19:49 +00:00
2024-03-15 09:55:44 +00:00
2024-01-05 22:29:31 +00:00
2024-02-08 08:32:46 +00:00
2022-04-21 19:28:34 -07:00
2023-04-23 02:57:10 -06:00
2023-01-20 21:07:56 -08:00
2023-03-04 22:36:00 -08:00
2022-11-30 15:31:49 -08:00
2023-12-13 12:38:19 +00:00
2023-04-27 21:23:46 +00:00
2022-10-05 14:57:11 -07:00
2023-05-19 16:54:50 +02:00
2024-03-06 15:07:08 +00:00
2022-04-14 17:23:57 +09:00
2023-01-22 13:45:55 -08:00
2022-05-05 21:24:16 +02:00
2022-04-29 12:22:46 -06:00
2022-03-30 12:00:27 +01:00
2023-09-28 20:58:24 +02:00
2024-03-13 10:03:17 +00:00
2023-12-23 18:09:46 -08:00
2024-01-16 18:56:31 +00:00
2022-04-06 11:22:39 -07:00
2022-10-15 08:09:20 -07:00
2024-08-02 15:09:45 +02:00
2022-03-11 23:25:14 +01:00
2022-04-02 11:35:13 +03:00
2022-04-02 11:35:13 +03:00
2022-04-02 11:35:13 +03:00
2024-02-04 16:16:57 +00:00
2022-11-07 01:41:08 -08:00
2022-01-11 11:15:42 -08:00
2024-03-19 14:21:42 +00:00
2022-04-25 16:26:43 -07:00
2022-06-11 04:20:52 -07:00
2022-07-05 16:40:17 +01:00
2022-10-03 19:10:00 -07:00
2024-09-03 15:07:13 +00:00
2022-04-26 10:45:08 -07:00
2023-12-07 17:46:30 +00:00
2022-01-27 13:55:58 +02:00
2024-01-22 15:00:33 +00:00
2023-08-27 03:57:32 -04:00
2022-02-03 11:20:08 +02:00
2024-01-17 20:26:09 +00:00
2024-01-19 20:35:57 +00:00
2023-03-13 04:33:38 -07:00
2022-06-18 07:41:25 -07:00
2024-03-29 00:38:13 +00:00
2023-05-09 09:46:25 -07:00
2022-11-02 12:12:31 -07:00
2024-01-09 22:41:02 +02:00
2023-05-31 16:40:25 +00:00
2022-03-31 09:11:35 -05:00
2023-12-29 09:57:21 +01:00
2022-04-29 18:22:10 -07:00
2024-09-04 17:52:54 +02:00
2022-11-27 03:19:02 -08:00