ensure that ctx is non-NULL

The code-path via the `ed25519ph_*()` APIs would have allowed to get here
and de-reference `ctx` even if it is `NULL`.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
Steffen Jaeckel 2022-09-02 11:35:11 +02:00 committed by Jamie Reece Wilson
parent fd41f04026
commit bb7712bd64

View File

@ -28,6 +28,7 @@ int ec25519_crypto_ctx(unsigned char *out, unsigned long *outlen, unsigned char
buf++;
if (ctxlen > 0u) {
LTC_ARGCHK(ctx != NULL);
XMEMCPY(buf, ctx, ctxlen);
buf += ctxlen;
}