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

Added if condition to avoid null pointer arithmetic #61

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

elanfer
Copy link
Contributor

@elanfer elanfer commented Nov 24, 2019

This error was shown to me by cppcheck, that it could be possible that buf is NULL. Performing arithmetic with NULL pointers may result in undefined behavior, so I caught this by checking if buf is NULL.

Compilation and test ran successfully after this change.

@LiamBindle
Copy link
Owner

Thanks for the PR @elanfer. This definitely looks ok to me

@LiamBindle LiamBindle merged commit 89dd34f into LiamBindle:master Nov 25, 2019
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