From 69a4607f84b3ebe1dc7cce7b2950137f95fb2de8 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Fri, 18 Apr 2025 16:47:36 -0600 Subject: [PATCH] null sanity check on arguments in wc_HpkeContextComputeNonce, CID 515543 --- wolfcrypt/src/hpke.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/src/hpke.c b/wolfcrypt/src/hpke.c index 4cd679f4d..8ce209fa7 100644 --- a/wolfcrypt/src/hpke.c +++ b/wolfcrypt/src/hpke.c @@ -586,6 +586,10 @@ static int wc_HpkeContextComputeNonce(Hpke* hpke, HpkeBaseContext* context, int ret; byte seq_bytes[HPKE_Nn_MAX]; + if (hpke == NULL || context == NULL) { + return BAD_FUNC_ARG; + } + /* convert the sequence into a byte string with the same length as the * nonce */ ret = I2OSP(context->seq, (int)hpke->Nn, seq_bytes);