Thanks to visit codestin.com Credit goes to github.com
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 3719779 commit c44f707Copy full SHA for c44f707
1 file changed
Modules/posixmodule.c
@@ -3320,12 +3320,22 @@ posix_getcwd(int use_bytes)
3320
Py_BEGIN_ALLOW_THREADS
3321
do {
3322
buflen += chunk;
3323
+#ifdef MS_WINDOWS
3324
+ if (buflen > INT_MAX) {
3325
+ PyErr_NoMemory();
3326
+ break;
3327
+ }
3328
+#endif
3329
tmpbuf = PyMem_RawRealloc(buf, buflen);
3330
if (tmpbuf == NULL)
3331
break;
3332
3333
buf = tmpbuf;
3334
3335
+ cwd = getcwd(buf, (int)buflen);
3336
+#else
3337
cwd = getcwd(buf, buflen);
3338
3339
} while (cwd == NULL && errno == ERANGE);
3340
Py_END_ALLOW_THREADS
3341
0 commit comments