]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-143012: use `Py_ssize_t` cast for `PyBytes_FromStringAndSize` (GH-143013...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 20 Dec 2025 08:02:44 +0000 (09:02 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Dec 2025 08:02:44 +0000 (08:02 +0000)
gh-143012: use `Py_ssize_t` cast for `PyBytes_FromStringAndSize` (GH-143013)
(cherry picked from commit 5989095dfd08735525f2b615066bc3c231b09388)

Co-authored-by: AZero13 <gfunni234@gmail.com>
Modules/posixmodule.c

index e11f16d0940f5e72db8c6e65ba66b6fe9794f8cf..da98bb1b6fbd741d00c64d3dcbc963ca7a3d0365 100644 (file)
@@ -1786,7 +1786,7 @@ convertenviron(void)
 #ifdef MS_WINDOWS
         k = PyUnicode_FromWideChar(*e, (Py_ssize_t)(p-*e));
 #else
-        k = PyBytes_FromStringAndSize(*e, (int)(p-*e));
+        k = PyBytes_FromStringAndSize(*e, (Py_ssize_t)(p-*e));
 #endif
         if (k == NULL) {
             Py_DECREF(d);