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

Various small fixes #88

Closed
wants to merge 7 commits into from
Closed

Various small fixes #88

wants to merge 7 commits into from

Conversation

bbonev
Copy link

@bbonev bbonev commented Jun 6, 2021

  • do not leak memory on error conditions
  • add checks for malloc returning NULL and fail
  • avoid OOB from snprintf with snprintf size > buffer size

The OOB can be seen as the following output:

./cpufetch

*** buffer overflow detected ***: terminated
Aborted

- check for malloc returning NULL
- do not leak memory on error coniditions
- check for malloc returning NULL
- do not leak memory on error coniditions
- check for malloc returning NULL
- do not leak memory on error coniditions
- avoid OOB memory access
- remove check for 31
- use 64bit type for the internal calculation
- check for malloc returning NULL
- do not leak memory on error coniditions
@bbonev
Copy link
Author

bbonev commented Jun 7, 2021

reopened as #90 to use the proper branch from my fork

@bbonev bbonev closed this Jun 7, 2021
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.

1 participant