Skip to content
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

Fix Windows crash on proc_username() #1289

Merged

Conversation

jmigot-tehtris
Copy link
Contributor

There is a crash possibility in proc_username() function on Windows platform, if any of the Windows API calls fail, because the to "goto error" which executes this:
Py_XDECREF(py_domain);
Py_XDECREF(py_username);
Py_XDECREF(py_tuple);

This will lead to deallocation of uninitialized random memory, which will segfault and crash the entire Python interperter.

… leading to "goto error"

This will prevent deallocation of random memory not initialized (by the way you should stop using "goto"...)
@giampaolo
Copy link
Owner

Mmm... possibly this could be related to #1258.
Patch LGTM. Merging.

@giampaolo giampaolo merged commit ac9dcca into giampaolo:master Jun 7, 2018
@giampaolo
Copy link
Owner

New release is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants