We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca05143 commit 87ab5aaCopy full SHA for 87ab5aa
Modules/posixmodule.c
@@ -4189,8 +4189,8 @@ posix_getcwd(int use_bytes)
4189
/* If the buffer is large enough, len does not include the
4190
terminating \0. If the buffer is too small, len includes
4191
the space needed for the terminator. */
4192
- if ((size_t)len >= Py_ARRAY_LENGTH(wbuf)) {
4193
- if (len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
+ if (len >= Py_ARRAY_LENGTH(wbuf)) {
+ if ((Py_ssize_t)len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
4194
wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t));
4195
}
4196
else {
0 commit comments