forked from davidmoreno/onion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove null pointer dereferences from davidmoreno#300
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.
- Loading branch information
Showing
3 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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