Skip to content

Conversation

@xingyaner
Copy link

Description

This PR fixes a fuzzing build error caused by unused variables (x, y, z) in wolfcrypt/src/ecc.c when compiling with -Werror and specific configurations .
In the function ecc_map_ex, the variables x, y, and z were declared at the top of the function but are only used within a specific #if !defined(WOLFSSL_SP_MATH) block. When WOLFSSL_SP_MATH is defined, these variables remain unused, triggering a -Wunused-variable error in strict build environments like OSS-Fuzz.

The fix moves the declaration of these variables into the inner scope where they are actually used, resolving the warning/error without changing any logic.
Fixes build error seen in OSS-Fuzz environments.

Testing

git clone https://github.com/google/oss-fuzz.git
git clone https://github.com/wolfSSL/wolfssl.git
cd oss-fuzz/
python3.10 infra/helper.py build_fuzzers wolfssl ~/wolfssl --sanitizer address --engine honggfuzz --architecture x86_64

In this way, you can see the same error message as described below.
After using the PR code, the fuzzing build can be successfully carried out.

Fuzzing build error URL
https://oss-fuzz-build-logs.storage.googleapis.com/index.html#wolfssl

@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented Jan 13, 2026

Hi @xingyaner , thank you for this PR. I do not see you on our contributors list. Can you please send your request to support at wolfssl dot com and include your location and a bit about yourself and project?
Thanks, David Garske, wolfSSL

@xingyaner
Copy link
Author

Hi @dgarske, as requested, I have sent an email to the support team with the required information. Please let me know if anything else is needed from my side. Thanks!

@dgarske
Copy link
Contributor

dgarske commented Jan 14, 2026

ZD 21045. Thank you @xingyaner for this report. For such a small fix we will treat as a bug report and reproduce and fix internally. Thanks, David Garske, wolfSSL

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.

3 participants