Skip to content

Commit 69a4607

Browse files
null sanity check on arguments in wc_HpkeContextComputeNonce, CID 515543
1 parent f834b9b commit 69a4607

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

wolfcrypt/src/hpke.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,10 @@ static int wc_HpkeContextComputeNonce(Hpke* hpke, HpkeBaseContext* context,
586586
int ret;
587587
byte seq_bytes[HPKE_Nn_MAX];
588588

589+
if (hpke == NULL || context == NULL) {
590+
return BAD_FUNC_ARG;
591+
}
592+
589593
/* convert the sequence into a byte string with the same length as the
590594
* nonce */
591595
ret = I2OSP(context->seq, (int)hpke->Nn, seq_bytes);

0 commit comments

Comments
 (0)