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 FILE resource leak #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

nmcclatchey
Copy link

Fixes resource leaks in npy_load() and npz_load() that would occur if an exception were to be thrown during load. Because NPY files can be constructed deliberately to trigger such exceptions, addressing this leak is vital for cases where programs may load user-supplied NPY files and attempt recovery on error.

Fixes issue rogersce#53, which notes that an exception thrown when loading an npz file would cause an open FILE pointer to be leaked. This bug could be triggered intentionally (via specially-crafted NPZ files), so fixing it is a priority.
Fixes issue rogersce#52, which notes that an exception thrown when loading an npy file would cause an open FILE pointer to be leaked. This bug could be triggered intentionally (via specially-crafted NPY files), so fixing it is a priority.
@nmcclatchey
Copy link
Author

Note: Resolves #52 and #53 .

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

Successfully merging this pull request may close these issues.

2 participants