fix: add NULL check before EVP_PKEY_check() in _new_key_from_parameters()#105
fix: add NULL check before EVP_PKEY_check() in _new_key_from_parameters()#105toddr-bot wants to merge 0 commit into
Conversation
PR Review — fix: add NULL check before EVP_PKEY_check() in _new_key_from_parameters()Clean, minimal fix. Adding Checklist
SummaryClean, minimal fix. Adding Automated review by Kōan |
|
@toddr-bot rebase |
|
❌ Permission denied. Only users with write access can trigger bot commands. |
|
@toddr-bot rebase |
timlegge
left a comment
There was a problem hiding this comment.
I think this can be closed. It looks to be taken care of already
376ef99 to
892eede
Compare
Rebase: fix: add NULL check before EVP_PKEY_check() in _new_key_from_parameters()Branch Review feedback was analyzed and applied. Actions
CICI passed. Automated by Kōan |
What
Add missing NULL check on
test_ctxbefore callingEVP_PKEY_check()in_new_key_from_parameters().Why
EVP_PKEY_CTX_new_from_pkey()can return NULL on allocation failure. Without a guard,EVP_PKEY_check(NULL)is undefined behavior — potential segfault. Thecheck_key()function at line 892 already handles this correctly viaCHECK_OPEN_SSL(pctx); this applies the same pattern usingTHROW.How
Single-line addition:
THROW(test_ctx != NULL)between allocation and use.THROWsets the error flag and jumps to theerr:cleanup label, consistent with the rest of the function.Testing
Full test suite passes (318 tests, 10 files).
🤖 Generated with Claude Code
Quality Report
Changes: 1 file changed, 1 insertion(+)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline