Repository navigation
Conversation
Used Claude code to search for `OQS_MEM_malloc` and similar calls where the output was not being checked for NULL. Added the checks where appropriate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Owen Waldron <owen.waldron@uwaterloo.ca>
Created the `test_malloc_null_check` to check that `OQS_MEM_*` calls are immediately followed by NULL checks, where appropriate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Owen Waldron <owen.waldron@uwaterloo.ca>
owaldron
requested review from
ashman-p,
bhess,
cothan,
dstebila and
xuganyu96
as code owners
October 15, 2026 19:58
RodriM11
reviewed
Oct 16, 2026
RodriM11
reviewed
Oct 16, 2026
RodriM11
reviewed
Oct 16, 2026
baentsch
reviewed
Oct 18, 2026
|
|
||
| # Ignore patterns to ignore false-positives in upstreams without the need to | ||
| # insert an `// IGNORE malloc-check`. | ||
| MALLOC_CHECK_IGNORED_DIRS = [ |
Member
There was a problem hiding this comment.
whenever I see algorithm-specific code I wince -- particularly if it's excluding algorithms from scrutiny. Why is this so in this case?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As mentioned in this comment, there are some outstanding
malloccalls that were missing NULL checks. This PR used @claude to search for such instances and add the appropriate guard. It also addstest_malloc_null_checkto verify that NULL guards immediately follow anyOQS_MEM_*calls, along with the ability to suppress false positives.Generative AI Disclosure: Claude Opus 5.5 was used to search the codebase for
OQS_MEM_*calls that were missing NULL-guards. The testtest_malloc_null_checkwas drafted by the same tool