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

Avoid a potential NULL dereference. #174

Closed
wants to merge 1 commit into from
Closed

Avoid a potential NULL dereference. #174

wants to merge 1 commit into from

Conversation

mansourmoufid
Copy link
Contributor

This moves a couple pointer accesses to after the NULL checks.

@mpg
Copy link
Contributor

mpg commented Feb 18, 2015

I agree that the code looks better after your patch, but I disagree there was a NULL dereference before: only the value of the pointer is accessed, not the value it points to.

@mpg
Copy link
Contributor

mpg commented Feb 18, 2015

I applied a change that fixes the problem in a slightly different way (your patch still leaves a dangling ssl->in_ctr around if the second allocation fails).

@mpg mpg closed this Feb 18, 2015
gilles-peskine-arm pushed a commit to gilles-peskine-arm/mbedtls that referenced this pull request Sep 3, 2019
Add mock tests for hooks for secure element drivers
hanno-becker pushed a commit to hanno-becker/mbedtls that referenced this pull request Apr 10, 2021
Simplify MPS writer and extended writer
iameli pushed a commit to livepeer/mbedtls that referenced this pull request Dec 5, 2023
avoid warning 'The macro AC_TRY_LINK is obsolete.'
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.

2 participants