Fix correctness findings from penpal testing#3235
Open
prasden wants to merge 9 commits into
Open
Conversation
samuel40791765
previously approved these changes
May 8, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3235 +/- ##
==========================================
+ Coverage 78.14% 78.37% +0.22%
==========================================
Files 689 689
Lines 123334 123352 +18
Branches 17172 17178 +6
==========================================
+ Hits 96384 96672 +288
+ Misses 26037 25768 -269
+ Partials 913 912 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
justsmth
reviewed
May 8, 2026
| if (written_bytes != NULL) { | ||
| *written_bytes = 0; | ||
| } | ||
| return 0; |
Contributor
There was a problem hiding this comment.
Is this still needed if we call it earlier in the function?
Contributor
Author
There was a problem hiding this comment.
It was redundant, removed.
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.
Issues:
Addresses: P409219367
Description of changes:
This PR adds a small series of correctness fixes brought up by Penpal testing:
BIO_write_exreturned early on NULL bio without initializing*written_bytesinbio.c.We now initializewritten_bytesto 0 before the NULL check so the caller receives that 0 bytes were written if any checks fail.NCONF_load_biohad a signed overflow in bufnum inconf.c. We now guard against overflow before the addition.BN_le2bndid not reset the sign flag when reusing an existing BIGNUM inbytes.c. We now clear it to avoid staleness.PEM_write_biopreviously used anintloop counter in pem_lib.c. We now uselongto match the input length type and prevent overflow.crl_cbinx_crl.cdid not freeidp/akidon error paths. We now free and NULL them before returning to prevent leaksBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.