Skip to content

Commit f6d7af2

Browse files
committed
Null terminate the sodium_crypto_kx_keypair() result
1 parent 2fe2e5b commit f6d7af2

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
@@ -2885,6 +2885,7 @@ PHP_FUNCTION(sodium_crypto_kx_keypair)
28852885
zend_throw_exception(sodium_exception_ce, "internal error", 0);
28862886
return;
28872887
}
2888+
ZSTR_VAL(keypair)[crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES] = 0;
28882889
RETURN_STR(keypair);
28892890
}
28902891

0 commit comments

Comments
 (0)