Browse Source

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 <[email protected]>
Steffen Jaeckel 3 years ago
parent
commit
97f78901e9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/pk/ec25519/ec25519_crypto_ctx.c

+ 1 - 0
src/pk/ec25519/ec25519_crypto_ctx.c

@@ -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;
   }