-
Notifications
You must be signed in to change notification settings - Fork 837
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
20250109-memory-errors #8349
Merged
JacobBarthelmeh
merged 3 commits into
wolfSSL:master
from
douzzer:20250109-memory-errors
Jan 10, 2025
Merged
20250109-memory-errors #8349
JacobBarthelmeh
merged 3 commits into
wolfSSL:master
from
douzzer:20250109-memory-errors
Jan 10, 2025
Conversation
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
dgarske
previously approved these changes
Jan 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SparkiDev please finalize.
douzzer
force-pushed
the
20250109-memory-errors
branch
5 times, most recently
from
January 10, 2025 03:33
0c07b6b
to
8587927
Compare
JacobBarthelmeh
requested changes
Jan 10, 2025
… true positives, unmasked by CPPFLAGS=-DNO_WOLFSSL_MEMORY: clang-analyzer-unix.Malloc, clang-analyzer-core.NullDereference, clang-analyzer-core.uninitialized.Assign, clang-analyzer-core.UndefinedBinaryOperatorResult, and clang-analyzer-optin.portability.UnixAPI (re malloc(0)). several fixes for defects reported by cppcheck: wolfcrypt/src/ecc.c: fix for cppcheck oppositeInnerCondition from cppcheck-2.16.0 in _ecc_make_key_ex(), and fixes for related unhandled errors discovered by manual inspection; wolfcrypt/test/test.c: fix XREALLOC call in memcb_test() to resolve cppcheck-detected memleak.
douzzer
force-pushed
the
20250109-memory-errors
branch
2 times, most recently
from
January 10, 2025 21:37
71096d6
to
156bdff
Compare
…0250104: wolfcrypt/src/integer.c: add additional guards against OOB access from uint wraps and null derefs of mp_int.dp, and refactor mp_grow() and mp_init_size() to use XMEMSET, for the benefit of clang-tidy. in mp_grow(), fix the condition for the realloc to assure always evaluated if a->alloc == 0. wolfcrypt/src/asn.c: fix wc_CreatePKCS8Key() so that *outSz is always assigned when LENGTH_ONLY_E is returned. wolfcrypt/src/pkcs7.c: remove redundant inner condition in wc_PKCS7_EncodeAuthEnvelopedData(), added in previous commit and caught on review by Jacob (thanks!). wolfcrypt/src/sp_int.c: in sp_mont_norm(), add another suppression for the same false positive in sp_mul() suppressed in previous commit. wolfcrypt/src/srp.c: refactor SrpHashSize() to return ALGO_ID_E rather than 0 when unknown/uncompiled alg is requested.
…ccept the algo and strength, for proper rendering on asym algs.
douzzer
force-pushed
the
20250109-memory-errors
branch
from
January 10, 2025 21:49
156bdff
to
dc2ada1
Compare
JacobBarthelmeh
approved these changes
Jan 10, 2025
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.
numerous fixes for memory errors reported by
clang-tidy
, most of them true positives, unmasked byCPPFLAGS=-DNO_WOLFSSL_MEMORY
:clang-analyzer-unix.Malloc
,clang-analyzer-core.NullDereference
,clang-analyzer-core.uninitialized.Assign
,clang-analyzer-core.UndefinedBinaryOperatorResult
, andclang-analyzer-optin.portability.UnixAPI
(remalloc(0)
).several fixes for memory error reported by
cppcheck
:wolfcrypt/src/ecc.c
: fix forcppcheck
oppositeInnerCondition
fromcppcheck-2.16.0
in_ecc_make_key_ex()
, and fixes for related unhandled errors discovered by manual inspection;wolfcrypt/test/test.c
: fixXREALLOC
call inmemcb_test()
to resolvecppcheck
-detected memleak.full
wolfssl-multi-test.sh
run underway.