Skip to content

Commit 5885eec

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Null terminate the sodium_crypto_kx_keypair() result
2 parents a0c231c + f6d7af2 commit 5885eec

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/sodium/libsodium.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,6 +2902,7 @@ PHP_FUNCTION(sodium_crypto_kx_keypair)
29022902
zend_throw_exception(sodium_exception_ce, "internal error", 0);
29032903
return;
29042904
}
2905+
ZSTR_VAL(keypair)[crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES] = 0;
29052906
RETURN_STR(keypair);
29062907
}
29072908

0 commit comments

Comments
 (0)