Skip to content

Commit

Permalink
secp256k1_schnorrsig_sign: initialize zNData to NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
afk11 committed Aug 26, 2019
1 parent e57439d commit f3cdcda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions secp256k1/secp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,7 @@ PHP_FUNCTION(secp256k1_schnorrsig_parse)
* Create an ECDSA signature. */
PHP_FUNCTION (secp256k1_schnorrsig_sign)
{
zval *zCtx, *zSig, *zNData;
zval *zCtx, *zSig, *zNData = NULL;
secp256k1_context *ctx;
secp256k1_schnorrsig *newsig;
zend_string *msg32, *seckey;
Expand Down Expand Up @@ -2069,7 +2069,11 @@ PHP_FUNCTION (secp256k1_schnorrsig_sign)
noncefp = php_secp256k1_nonce_function_callback;
calldata.fci = &fci;
calldata.fcc = &fcc;
calldata.data = zNData;
if (zNData == NULL) {
calldata.data = NULL;
} else {
calldata.data = zNData;
}
ndata = (void *) &calldata;
} else {
noncefp = secp256k1_nonce_function_bipschnorr;
Expand Down

0 comments on commit f3cdcda

Please sign in to comment.