New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
char buffer in function posix_getcwdu should not be fix length #51066
Comments
This issue is similar to bpo-2722 (http://bugs.python.org/issue2722#), In the function posix_getcwdu(), the char buffer is still fix length. But |
Your patch is mixing tabs and spaces :-/ A "free(tmpbuf);" is missing in "if (res == NULL) return posix_error();". |
The "#ifdef MS_WINDOWS" is not a the right place in posix_getcwdu(): buf and The patch only fixes the UNIX implementation, not the Windows In the py3k branch, bytes and unicode versions of getcwd are factorized in a |
Victor, I corrected both issues of the patch according to your first comment. This patch did not fix the Windows implementation. It seems that there len = GetCurrentDirectoryW(sizeof wbuf/ sizeof wbuf[0], wbuf);
if (len >= sizeof wbuf/ sizeof wbuf[0]) {
wbuf2 = malloc(len * sizeof(wchar_t));
if (wbuf2)
len = GetCurrentDirectoryW(len, wbuf2);
} |
I'm marking this as a duplicate of bpo-9246. It's better to change |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: