Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3047 +/- ##
=======================================
Coverage 78.35% 78.35%
=======================================
Files 689 689
Lines 121041 121050 +9
Branches 16968 16973 +5
=======================================
+ Hits 94839 94854 +15
+ Misses 25306 25300 -6
Partials 896 896 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Description of changes:
Fixes several issues in
crypto/evp_extra/p_dh_asn1.c:dh_pub_decode: Fixed an unreachable double-free. After ownership ofpubkeyis transferred to theDHobject viadh->pub_key = pubkey, the error path would free it twice — once throughDH_free(dh)and again viaBN_free(pubkey). This is currently unreachable becauseEVP_PKEY_assign_DHalways succeeds whendhis non-NULL, but a future refactor could easily trigger it. Fixed by nulling the local pointer after the ownership transfer.dh_pub_decode: Added aCBS_len(key) != 0check after parsing the public key to reject trailing data, consistent with the RSA, DSA, and ECpub_decodeimplementations.dh_param_copy: Fixed a NULL dereference whento->pkey.dhis NULL by allocating a newDHobject on demand.dh_pub_encode: Added an early NULL check for theDHobject and its public key.Call-outs:
These are defensive fixes hardening error paths and edge cases.
Testing:
Existing tests continue to pass.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.