From 765ba55cdc9ef6f4b9e9fb34403da8790d2956f0 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 16 Jul 2017 16:37:47 +0200 Subject: [PATCH] crypto_kx(): abort if the function is called without any non-NULL pointer --- src/libsodium/crypto_kx/crypto_kx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libsodium/crypto_kx/crypto_kx.c b/src/libsodium/crypto_kx/crypto_kx.c index ef878d94..67e2f00e 100644 --- a/src/libsodium/crypto_kx/crypto_kx.c +++ b/src/libsodium/crypto_kx/crypto_kx.c @@ -47,6 +47,9 @@ crypto_kx_client_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES], if (tx == NULL) { tx = rx; } + if (rx == NULL) { + abort(); + } if (crypto_scalarmult(q, client_sk, server_pk) != 0) { return -1; }