Remove null pointer dereferences from #300#310
Open
YggdrasiI wants to merge 1 commit intodavidmoreno:masterfrom
Open
Remove null pointer dereferences from #300#310YggdrasiI wants to merge 1 commit intodavidmoreno:masterfrom
YggdrasiI wants to merge 1 commit intodavidmoreno:masterfrom
Conversation
This commit resolves three null pointer dereferences mentioned by Bogdanisar. Comments about changes: 1) onion.c Add return statement if promotion to https had failed and set member variable only in !=NULL case. 2) Here, I'm unsure if my change is correct. I assume that the NULL-check is using the wrong variable! First of all, a check of the bl variable is missing. This indicates that (bl == NULL) would be the correct check. Moreover, the redis session probably should be deleted if the data dict is empty, too. Thus, I changed the line to if (onion_dict_count(data) == 0 || bl == NULL) Other variants would be if (bl == NULL) if (data == NULL || bl == NULL ) 3) poller.c: If added a NULL check because poller->head is initialized with NULL in onion_poller_new.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit resolves three null pointer dereferences mentioned by Bogdanisar in #300.
Comments about changes:
onion.c
Add return statement if promotion to https had failed
and set member variable only in
!=NULLcase.Here, I'm unsure if my change is correct.
I assume that the NULL-check is using the wrong variable!
First of all, a check of the bl variable is missing. This indicates
that
(bl == NULL)would be the correct check.Moreover, the redis session probably should be deleted if the data
dict is empty, too. Thus, I changed the line to
if (onion_dict_count(data) == 0 || bl == NULL)Other variants would be
if (bl == NULL)if (data == NULL || bl == NULL )If added a NULL check because poller->head is initialized
with NULL in onion_poller_new.