-
Notifications
You must be signed in to change notification settings - Fork 25
Fix coverity issues #162
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
Fix coverity issues #162
Conversation
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.
Pull Request Overview
This PR addresses Coverity static analysis findings by initializing request/response structures and adding type casts to prevent potential integer overflow issues. Key changes include adding explicit zero-initialization to message structures and casting values to uint16_t when creating key IDs.
- Initialize request and response structures with zero-initialization syntax
- Add type casts to prevent potential integer overflow in key ID generation
- Replace usleep with nanosleep for better POSIX compliance
- Update build system and configuration files for consistency
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/wh_server_keystore.c | Initialize req/resp structs and add uint16_t casts for key ID generation |
| src/wh_server_crypto.c | Add conditional checks before function calls and initialize response struct |
| src/wh_server_counter.c | Initialize req/resp structs and add uint16_t casts |
| src/wh_comm.c | Add null pointer checks for hdr field |
| test/wh_test_comm.c | Replace usleep with nanosleep and update timing constants |
| test/wh_test_common.h | Add conditional compilation for debug print macros |
| test/wh_test_wolfcrypt_test.c | Update conditional compilation guards |
| Various Makefiles and configs | Standardize build system and configuration settings |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
* add sha2-224, 384 and 512 * addressed code review add missing Dma handling * fix Sha512 tests enable sha224, sha384 and sh512 as default enable sha224, sha384 and sha512 at tcp server * addressed code review comments * unify Sha2 Dma Request/Response addressed review comment * run clang-format
* add sha2-224, 384 and 512 * addressed code review add missing Dma handling * fix Sha512 tests enable sha224, sha384 and sh512 as default enable sha224, sha384 and sha512 at tcp server * addressed code review comments * unify Sha2 Dma Request/Response addressed review comment * run clang-format
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.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bigbrett
left a comment
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.
@jackctj117 run git-clang-format main, and please address the removal of AI slop code in my earlier comments (don't worry about the resp.ok one for now)
6e300cb to
3504fc4
Compare
Based on coverity report I added some initialization and potential int overflow issues.