From f89f8d941172ef7794c5f5459800c4e6df747bd4 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 29 May 2016 18:53:20 +0100 Subject: [PATCH] Use fixed PHPC_HASH_CSTR_ADD_PTR --- gnupg.c | 4 ++-- phpc | 2 +- tests/gnupg_oo_encrypt.phpt | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gnupg.c b/gnupg.c index 59cc0cb..af20050 100644 --- a/gnupg.c +++ b/gnupg.c @@ -758,7 +758,7 @@ PHP_FUNCTION(gnupg_addsignkey) gpgme_subkey = gpgme_key->subkeys; while (gpgme_subkey) { if (gpgme_subkey->can_sign == 1) { - PHPC_HASH_CSTR_ADD_PTR(PHPC_THIS->signkeys, gpgme_subkey->keyid, passphrase); + PHPC_HASH_CSTR_ADD_PTR(PHPC_THIS->signkeys, gpgme_subkey->keyid, passphrase, passphrase_len + 1); } gpgme_subkey = gpgme_subkey->next; } @@ -801,7 +801,7 @@ PHP_FUNCTION(gnupg_adddecryptkey) gpgme_subkey = gpgme_key->subkeys; while (gpgme_subkey) { if (gpgme_subkey->secret == 1) { - PHPC_HASH_CSTR_ADD_PTR(PHPC_THIS->decryptkeys, gpgme_subkey->keyid, passphrase); + PHPC_HASH_CSTR_ADD_PTR(PHPC_THIS->decryptkeys, gpgme_subkey->keyid, passphrase, passphrase_len + 1); } gpgme_subkey = gpgme_subkey->next; } diff --git a/phpc b/phpc index 3cc9a2f..6b74383 160000 --- a/phpc +++ b/phpc @@ -1 +1 @@ -Subproject commit 3cc9a2fe8b23f4ff95bc650fc9ac66f92905621f +Subproject commit 6b7438355cfda1ed3e4895f21686914b794671d0 diff --git a/tests/gnupg_oo_encrypt.phpt b/tests/gnupg_oo_encrypt.phpt index 98627ab..be415af 100644 --- a/tests/gnupg_oo_encrypt.phpt +++ b/tests/gnupg_oo_encrypt.phpt @@ -9,7 +9,6 @@ $gpg = new gnupg(); $gpg -> seterrormode(gnupg::ERROR_WARNING); $gpg -> addencryptkey($fingerprint); $enc = $gpg -> encrypt($plaintext); - $gpg = NULL; $gpg = new gnupg();