Repository navigation
memory.c: guard wc_MemFailCount_AllocFailed to its call-site config - #12085
danielinux wants to merge 2 commits into
Conversation
All three call sites (the TRAP_MALLOC_SZ path, the FORCE_MALLOC_FAIL_TEST path, and the plain wolfSSL_Malloc path) live in the !WOLFSSL_STATIC_MEMORY allocator. The definition is gated only on WOLFSSL_MEM_FAIL_COUNT, so a build with WOLFSSL_STATIC_MEMORY + WOLFSSL_MEM_FAIL_COUNT (a valid test configuration, and the one tests/unit-mcdc/test_memory_whitebox.c compiles memory.c under) leaves the static function unused and breaks -Werror,-Wunused-function builds. Restrict the definition to !WOLFSSL_STATIC_MEMORY, matching its callers. Verified: strict white-box compile (the memory white-box TU with the library's -Werror flags, no -Wno-error=unused-function) fails on origin/master with exactly 'unused function wc_MemFailCount_AllocFailed' and passes with this guard; guard matrix compiles clean (static+failcount, non-static+failcount, +TRAP_MALLOC_SZ, +FORCE_MALLOC_FAIL_TEST, static only); infra MC/DC module green end-to-end.
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12085
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Max
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12085
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
|
jenkins retest this please |
Found by mc/dc campaign.
All three call sites (the TRAP_MALLOC_SZ path, the FORCE_MALLOC_FAIL_TEST path, and the plain wolfSSL_Malloc path) live in the !WOLFSSL_STATIC_MEMORY allocator. The definition is gated only on WOLFSSL_MEM_FAIL_COUNT, so a build with WOLFSSL_STATIC_MEMORY + WOLFSSL_MEM_FAIL_COUNT (a valid test configuration, and the one tests/unit-mcdc/test_memory_whitebox.c compiles memory.c under) leaves the static function unused and breaks -Werror,-Wunused-function builds.
Restrict the definition to !WOLFSSL_STATIC_MEMORY, matching its callers.
Verified: strict white-box compile (the memory white-box TU with the library's -Werror flags, no -Wno-error=unused-function) fails on origin/master with exactly 'unused function wc_MemFailCount_AllocFailed' and passes with this guard; guard matrix compiles clean (static+failcount, non-static+failcount, +TRAP_MALLOC_SZ, +FORCE_MALLOC_FAIL_TEST, static only); infra MC/DC module green end-to-end.
Testing
How did you test?
Checklist