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

Exercices-Mod1-L2PE-PeSelfLoad-Main.cpp - logical bug #6

Closed
BlueSkeye opened this issue Mar 23, 2021 · 0 comments
Closed

Exercices-Mod1-L2PE-PeSelfLoad-Main.cpp - logical bug #6

BlueSkeye opened this issue Mar 23, 2021 · 0 comments

Comments

@BlueSkeye
Copy link

BlueSkeye commented Mar 23, 2021

On line 202 you retrieve file size but fail to check for INVALID_FILE_SIZE (-1) return value.
Should GetFileSize fail on a 32 bit system, allocation on line 204 will throw an std::bad_array_new_length exception.

Additionally you don't check either the result of the byte array allocation which could fail on very big files or in case of high memory pressure.

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

No branches or pull requests

1 participant