Skip to content

Commit 124260c

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Null terminate the sodium_crypto_kx_keypair() result
2 parents 86072d6 + 5885eec commit 124260c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/sodium/libsodium.c

+1
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,7 @@ PHP_FUNCTION(sodium_crypto_kx_keypair)
24952495
zend_throw_exception(sodium_exception_ce, "internal error", 0);
24962496
RETURN_THROWS();
24972497
}
2498+
ZSTR_VAL(keypair)[crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES] = 0;
24982499
RETURN_STR(keypair);
24992500
}
25002501

0 commit comments

Comments
 (0)