Cody Maloney
db4b1948bc
gh-143008: Fix Null pointer dereferences in TextIOWrapper underlying stream access ( #145957 )
...
TextIOWrapper keeps its underlying stream in a member called
`self->buffer`. That stream can be detached by user code, such as custom
`.flush` implementations resulting in `self->buffer` being set to NULL.
The implementation often checked at the start of functions if
`self->buffer` is in a good state, but did not always recheck after
other Python code was called which could modify `self->buffer`.
The cases which need to be re-checked are hard to spot so rather than
rely on reviewer effort create better safety by making all self->buffer
access go through helper functions.
Thank you yihong0618 for the test, NEWS and initial implementation in
gh-143041.
Co-authored-by: yihong0618 <zouzou0208@gmail.com >
Co-authored-by: Victor Stinner <vstinner@python.org >
2026-06-09 12:31:44 +02:00
..
2026-06-02 21:13:34 +01:00
2026-06-01 13:41:21 -05:00
2026-05-15 14:42:30 +02:00
2026-06-09 12:31:44 +02:00
2026-05-24 16:16:12 +03:00
2026-05-26 01:37:14 +01:00
2026-06-04 16:41:47 +03:00
2026-06-07 21:06:36 +09:00
2026-03-25 07:44:47 +01:00
2026-05-26 00:03:06 +09:00
2026-05-28 12:27:37 +01:00
2026-05-24 16:16:12 +03:00
2026-04-09 08:52:30 +01:00
2026-05-24 15:03:22 +03:00
2026-05-24 16:16:12 +03:00
2026-06-04 13:31:31 +00:00
2026-05-14 01:21:03 +02:00
2026-05-24 16:16:12 +03:00
2026-06-02 21:13:34 +01:00
2026-05-24 16:16:12 +03:00
2026-06-07 08:19:05 -07:00
2026-05-24 16:16:12 +03:00
2026-06-04 13:31:31 +00:00
2026-04-11 15:18:02 -07:00
2026-05-24 15:02:12 +03:00
2026-05-24 15:02:12 +03:00
2026-06-08 14:11:36 +03:00
2026-05-24 16:16:12 +03:00
2026-05-27 13:23:28 +03:00
2026-06-02 21:13:34 +01:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-17 13:09:19 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-03-24 17:47:55 +00:00
2026-04-07 22:56:19 +02:00
2026-05-28 08:05:03 -07:00
2026-05-24 16:16:12 +03:00
2026-04-02 23:20:13 +02:00
2026-06-01 17:32:13 +03:00
2026-05-24 16:16:12 +03:00
2026-06-02 21:13:34 +01:00
2026-05-18 18:39:54 +03:00
2026-05-03 20:20:51 +00:00
2026-04-15 15:59:02 +02:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-03-26 15:26:34 +01:00
2026-05-06 17:39:30 -04:00
2026-03-17 12:16:35 +02:00
2026-05-22 21:47:32 +02:00
2026-05-05 09:18:04 +02:00
2026-05-24 16:16:12 +03:00
2026-04-08 09:15:11 +02:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-23 00:04:51 +02:00
2026-04-04 13:29:17 +01:00
2026-06-02 21:13:34 +01:00
2026-03-24 17:47:55 +00:00
2026-05-12 22:46:46 +03:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-03-24 17:47:55 +00:00
2026-06-06 17:03:04 +00:00
2026-03-09 19:37:33 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-06-02 21:13:34 +01:00
2026-04-02 23:20:13 +02:00
2026-03-24 17:47:55 +00:00
2026-06-06 10:19:45 +00:00
2026-03-24 17:47:55 +00:00
2026-06-07 16:01:24 +03:00
2026-05-24 16:16:12 +03:00
2026-06-04 13:31:31 +00:00
2026-03-24 17:47:55 +00:00
2026-05-30 00:23:32 +03:00
2026-05-30 19:26:05 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-13 18:35:50 +02:00
2026-05-13 18:35:50 +02:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-30 16:25:40 +00:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-26 01:37:14 +01:00
2026-06-06 11:34:33 +03:00
2026-06-06 11:34:33 +03:00
2026-05-13 18:35:50 +02:00
2026-05-13 18:35:50 +02:00
2026-05-13 18:35:50 +02:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00