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

reference leak in module init #3

Closed
maxbachmann opened this issue Aug 11, 2021 · 1 comment
Closed

reference leak in module init #3

maxbachmann opened this issue Aug 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@maxbachmann
Copy link
Member

maxbachmann commented Aug 11, 2021

Inside module init strings are created:

#ifdef LEV_PYTHON3
    opcode_names[i].pystring
      = PyUnicode_InternFromString(opcode_names[i].cstring);
#else
    opcode_names[i].pystring
      = PyString_InternFromString(opcode_names[i].cstring);
#endif
    opcode_names[i].len = strlen(opcode_names[i].cstring);

These strings are not NULL checked, so if allocation fails strlen causes a segmentation fault.
In addition the strings are not deallocated since the reference count is never cleared.

@maxbachmann maxbachmann added the bug Something isn't working label Aug 11, 2021
@maxbachmann
Copy link
Member Author

Fixed in #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant