]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143012: use `Py_ssize_t` cast for `PyBytes_FromStringAndSize` (#143013)
authorAZero13 <gfunni234@gmail.com>
Sat, 20 Dec 2025 07:37:10 +0000 (02:37 -0500)
committerGitHub <noreply@github.com>
Sat, 20 Dec 2025 07:37:10 +0000 (10:37 +0300)
Modules/posixmodule.c

index 221cfc5a93419802f7a5f6267aece1796d25bd6e..e0276ce9e3906faf408bfabe286d0dfbd04290a2 100644 (file)
@@ -1815,7 +1815,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);