Skip to content

Commit

Permalink
Null terminate the sodium_crypto_kx_keypair() result
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Aug 14, 2020
1 parent 2fe2e5b commit f6d7af2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/sodium/libsodium.c
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,7 @@ PHP_FUNCTION(sodium_crypto_kx_keypair)
zend_throw_exception(sodium_exception_ce, "internal error", 0);
return;
}
ZSTR_VAL(keypair)[crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES] = 0;
RETURN_STR(keypair);
}

Expand Down

0 comments on commit f6d7af2

Please sign in to comment.