Skip to content

Fix uninitialized pointer in PBKDF2 macro#21

Merged
kamilwaz merged 1 commit into
mainfrom
fix-uninitialized-pointer
Apr 23, 2026
Merged

Fix uninitialized pointer in PBKDF2 macro#21
kamilwaz merged 1 commit into
mainfrom
fix-uninitialized-pointer

Conversation

@kamilwaz

@kamilwaz kamilwaz commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a compilation error caused by an uninitialized pointer in the PBKDF2 macro.

Error:

===> /Users/kamilwaz/Workspace/esl/fast_pbkdf2.git/x-main/c_src/fast_pbkdf2.c:381:1: error: default initialization of an object of type 'HMAC_sha1_ctx_round *const restrict' leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe]
  381 | DECL_PBKDF2(sha1, SHA_CBLOCK, SHA_DIGEST_LENGTH, 3350 / SLICE)
      | ^
/Users/kamilwaz/Workspace/esl/fast_pbkdf2.git/x-main/c_src/fast_pbkdf2.c:213:47: note: expanded from macro 'DECL_PBKDF2'
  213 |         HMAC_CTX_ROUND(_name) *const restrict round_st;

Environment:

$ cc --version
Apple clang version 21.0.0 (clang-2100.0.123.102)
Target: arm64-apple-darwin25.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@kamilwaz kamilwaz self-assigned this Apr 22, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.31%. Comparing base (7302a0b) to head (3c718e7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #21   +/-   ##
=======================================
  Coverage   63.31%   63.31%           
=======================================
  Files           2        2           
  Lines         199      199           
  Branches       44       44           
=======================================
  Hits          126      126           
  Misses         73       73           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kamilwaz kamilwaz marked this pull request as ready for review April 22, 2026 11:56

@NelsonVides NelsonVides left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, this wasn't a const pointer really, it's modified just below 👍🏽

@kamilwaz kamilwaz merged commit 1157503 into main Apr 23, 2026
23 of 24 checks passed
@kamilwaz kamilwaz deleted the fix-uninitialized-pointer branch April 23, 2026 06:48
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.

4 participants