Files
cpython/Modules
Miss Islington (bot) 4f8a77bf3f [3.14] gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106) (#148404)
gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106)

When a custom iterator calls next() on the same csv.reader from
within __next__, the inner iteration sets self->fields to NULL.
The outer iteration then crashes in parse_save_field() by passing
NULL to PyList_Append.

Add a guard after PyIter_Next() to detect that fields was set to
NULL by a re-entrant call, and raise csv.Error instead of crashing.
(cherry picked from commit 20994b1809)

Co-authored-by: Ramin Farajpour Cami <ramin.blackhat@gmail.com>
2026-04-11 22:46:26 +00:00
..

Source files for standard library extension modules,
and former extension modules that are now builtin modules.