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 derefence of NULL pointer #2963

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rootkea
Copy link
Contributor

@rootkea rootkea commented Oct 27, 2021

Hello!

This fixes dereference of ft (NULL pointer) down the code.

Found by: scan-build

@elextr
Copy link
Member

elextr commented Oct 27, 2021

Since its tested a billion [exaggeration for effect] times a few more won't hurt. The pointer is/should be set to a valid value at document creation and all the tests removed, but since this is C not C++ the invariant can't be guaranteed against accidental/deliberate violation. [end rant, ducks missile from @b4n] 😄

In both cases I would have put the tests at the end of the block above which also tests for ft == NULL since it will only be null if that block fails.

Found by: scan-build
@rootkea
Copy link
Contributor Author

rootkea commented Nov 25, 2021

In both cases I would have put the tests at the end of the block above which also tests for ft == NULL since it will only be null if that block fails.

Sorry for the delay. Done now! :)

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