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

(Session Three) Fixes file.c nameLen member usage #7

Merged
merged 1 commit into from
May 5, 2021

Conversation

Menshin
Copy link
Contributor

@Menshin Menshin commented May 2, 2021

In the file.c exercice of the session three, info->nameLen seems to not work as intended :

  • it's set while reading the keyfile (and not the username file) and always valued 3 (4 bytes read for an int, minus one).
  • it's then used to allocated memory for the password calculation (which can only be of length greater or equal to 8), leading to write outside the allocated memory.

I've restored it to its percieved intended usage : set when reading the username file (discarding the linefeed char) and used to properly bound the password calculation/check.

Also fixes some minor typos in error messages while i was at it.
There's also some issues with malloc not being properly freed but i think that's mostly done to keep the code structure simpler to RE.

If this PR goes in, the binary will have to be regenerated too.
Please disregard if irrelevant, thanks for the good course anyway !

* Fixed some typos on error messages
@wrongbaud wrongbaud merged commit 413898a into wrongbaud:master May 5, 2021
@wrongbaud
Copy link
Owner

Will merge and rebuild the binary, thank you for finding this! There are undoubtedly more things that slipped through when I developed this so I really appreciate you taking the time to help make this better!

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.

None yet

2 participants