]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-129409: Fix Integer overflow - SEGV while writing data more than 2GB in...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 29 Jan 2025 11:39:16 +0000 (12:39 +0100)
committerGitHub <noreply@github.com>
Wed, 29 Jan 2025 11:39:16 +0000 (11:39 +0000)
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 (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com>
Misc/NEWS.d/next/Library/2025-01-29-14-30-54.gh-issue-129409.JZbOE6.rst [new file with mode: 0644]
Modules/_csv.c

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 (file)
index 0000000..7e00b44
--- /dev/null
@@ -0,0 +1,2 @@
+Fix an integer overflow in the :mod:`csv` module when writing a data field
+larger than 2GB.
index 0d315088c7a55a474154e17ec8aa276c78a1b996..f9387abe0e663a78da2e2874f3894064144879aa 100644 (file)
@@ -1116,7 +1116,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 \