Skip to content
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 reversed calloc() arguments #119

Merged
merged 1 commit into from
Feb 2, 2024
Merged

Fix reversed calloc() arguments #119

merged 1 commit into from
Feb 2, 2024

Conversation

sgallagher
Copy link
Contributor

@sgallagher sgallagher commented Feb 2, 2024

The prototype is "void *calloc(size_t nelem, size_t elsize);"

These two instances had them reversed, almost certainly leading to buffer overflow issues. This was detected by
-Werror=calloc-transposed-args on gcc.

Fixes #117

The prototype is "void *calloc(size_t nelem, size_t elsize);"

These two instances had them reversed, almost certainly leading to
buffer overflow issues. This was detected by
-Werror=calloc-transposed-args on gcc.

Signed-off-by: Stephen Gallagher <[email protected]>
@sgallagher
Copy link
Contributor Author

@vathpela Could you have a look at this? The pesign package fails to build on Fedora 40 due to this.

@vathpela
Copy link
Contributor

vathpela commented Feb 2, 2024

Really not seeing how this could "almost certainly" (or at all?) lead to buffer overflow issues, but sure, it's wrong and the fix looks fine.

@vathpela vathpela merged commit 1f9e2fa into rhboot:main Feb 2, 2024
2 checks passed
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.

116: is not gcc 14.x ready (buid fails with [-Werror=calloc-transposed-args])
2 participants