From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 29 Jan 2025 11:32:54 +0000 (+0100) Subject: [3.12] gh-129409: Fix Integer overflow - SEGV while writing data more than 2GB in... X-Git-Tag: v3.12.9~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cdaec318cb9189b7b74d46432532a3f88ec4c249;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-129409: Fix Integer overflow - SEGV while writing data more than 2GB in CSV file (GH-129413) (#129437) gh-129409: Fix Integer overflow - SEGV while writing data more than 2GB in CSV file (GH-129413) (cherry picked from commit 97b0ef05d987ebef354512b516a246feb411e815) Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) --- diff --git a/Misc/NEWS.d/next/Library/2025-01-29-14-30-54.gh-issue-129409.JZbOE6.rst b/Misc/NEWS.d/next/Library/2025-01-29-14-30-54.gh-issue-129409.JZbOE6.rst new file mode 100644 index 000000000000..7e00b44c0ef4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-01-29-14-30-54.gh-issue-129409.JZbOE6.rst @@ -0,0 +1,2 @@ +Fix an integer overflow in the :mod:`csv` module when writing a data field +larger than 2GB. diff --git a/Modules/_csv.c b/Modules/_csv.c index 9a7b7d27c2ed..df7207d0894a 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -1074,7 +1074,7 @@ join_append_data(WriterObj *self, int field_kind, const void *field_data, int copy_phase) { DialectObj *dialect = self->dialect; - int i; + Py_ssize_t i; Py_ssize_t rec_len; #define INCLEN \