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

Remove null pointer dereferences from #300 #310

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

Conversation

YggdrasiI
Copy link
Contributor

This commit resolves three null pointer dereferences mentioned by Bogdanisar in #300.

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 )

  1. poller.c:
    If added a NULL check because poller->head is initialized
    with NULL in onion_poller_new.

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.
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