fixed double-free with recent gpgme-lib

adjusted testfiles
going 1.3.1
This commit is contained in:
Thilo Raufeisen 2007-05-04 12:26:17 +00:00
parent 19dcb9fda3
commit 42c62c0ee8
5 changed files with 37 additions and 25 deletions

11
gnupg.c
View file

@ -27,7 +27,7 @@
static int le_gnupg;
#define PHP_GNUPG_VERSION "1.3"
#define PHP_GNUPG_VERSION "1.3.1"
#ifdef ZEND_ENGINE_2
static zend_object_handlers gnupg_object_handlers;
@ -934,7 +934,6 @@ PHP_FUNCTION(gnupg_sign){
RETVAL_STRINGL (userret,ret_size,1);
}
gpgme_data_release (in);
free (out);
free (userret);
}
@ -993,7 +992,6 @@ PHP_FUNCTION(gnupg_encrypt){
}
userret = gpgme_data_release_and_get_mem(out,&ret_size);
gpgme_data_release (in);
free (out);
RETVAL_STRINGL (userret,ret_size,1);
free (userret);
if(ret_size < 1){
@ -1077,7 +1075,6 @@ PHP_FUNCTION(gnupg_encryptsign){
userret = gpgme_data_release_and_get_mem(out,&ret_size);
gpgme_data_release (in);
free (out);
RETVAL_STRINGL (userret,ret_size,1);
free (userret);
if(ret_size < 1){
@ -1166,10 +1163,8 @@ PHP_FUNCTION(gnupg_verify){
ZVAL_STRINGL (plain_text, gpg_plain,gpg_plain_len,1);
}
free (gpg_plain);
gpgme_data_release_and_get_mem(gpgme_text,&gpg_plain_len);
}
gpgme_data_release (gpgme_sig);
free (gpgme_text);
}
/* }}} */
@ -1227,7 +1222,6 @@ PHP_FUNCTION(gnupg_decrypt){
}
userret = gpgme_data_release_and_get_mem(out,&ret_size);
gpgme_data_release (in);
free (out);
RETVAL_STRINGL (userret,ret_size,1);
free (userret);
if(ret_size < 1){
@ -1292,7 +1286,6 @@ PHP_FUNCTION(gnupg_decryptverify){
if (decrypt_result->unsupported_algorithm){
GNUPG_ERR ("unsupported algorithm");
gpgme_data_release(in);
free(out);
return;
}
verify_result = gpgme_op_verify_result (intern->ctx);
@ -1304,7 +1297,6 @@ PHP_FUNCTION(gnupg_decryptverify){
}
gnupg_fetchsignatures (verify_result->signatures,sig_arr,return_value);
gpgme_data_release (in);
free (out);
}
/* }}} */
@ -1346,7 +1338,6 @@ PHP_FUNCTION(gnupg_export){
RETVAL_FALSE;
}
free(userret);
free(out);
}
/* }}} */

View file

@ -14,13 +14,11 @@
</maintainer>
</maintainers>
<release>
<version>1.3</version>
<date>2006-11-06</date>
<version>1.3.1</version>
<date>2007-05-04</date>
<license>BSD, revised</license>
<state>stable</state>
<notes>PHP 5.2 compatibility
gnupg_deletekey now allows deleting a secret key in procedural usage
raised min version to 4.4</notes>
<notes>fixed double-free with recent gpgme-lib</notes>
<deps>
<dep type="php" rel="ge" version="4.4"/>
</deps>
@ -62,6 +60,13 @@ raised min version to 4.4</notes>
</filelist>
</release>
<changelog>
<release>
<version>1.3.1</version>
<date>2007-05-04</date>
<license>BSD, revised</license>
<state>stable</state>
<notes>fixed double-free with recent gpgme-lib</notes>
</release>
<release>
<version>1.3</version>
<date>2006-11-06</date>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.4.9" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
<package packagerversion="1.4.11" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
http://pear.php.net/dtd/tasks-1.0.xsd
http://pear.php.net/dtd/package-2.0
http://pear.php.net/dtd/package-2.0.xsd">
@ -15,20 +15,18 @@ http://pear.php.net/dtd/package-2.0.xsd">
<email>traufeisen@php.net</email>
<active>yes</active>
</lead>
<date>2006-11-06</date>
<time>15:53:22</time>
<date>2007-05-04</date>
<time>14:26:36</time>
<version>
<release>1.3</release>
<api>1.3</api>
<release>1.3.1</release>
<api>1.3.1</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license>BSD, revised</license>
<notes>PHP 5.2 compatibility
gnupg_deletekey now allows deleting a secret key in procedural usage
raised min version to 4.4
<notes>fixed double-free with recent gpgme-lib
</notes>
<contents>
<dir name="/">
@ -81,6 +79,20 @@ raised min version to 4.4
<providesextension>gnupg</providesextension>
<extsrcrelease />
<changelog>
<release>
<version>
<release>1.3.1</release>
<api>1.3.1</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<date>2007-05-04</date>
<license uri="http://www.example.com">BSD, revised</license>
<notes>fixed double-free with recent gpgme-lib
</notes>
</release>
<release>
<version>
<release>1.3</release>

View file

@ -72,7 +72,9 @@ array(1) {
bool(false)
}
[1]=>
array(10) {
array(11) {
["fingerprint"]=>
string(40) "A3437D3651E27CF9864198F0BFE8D07DDACDEAC8"
["keyid"]=>
string(16) "BFE8D07DDACDEAC8"
["timestamp"]=>

View file

@ -70,7 +70,9 @@ array(1) {
bool(false)
}
[1]=>
array(10) {
array(11) {
["fingerprint"]=>
string(40) "A3437D3651E27CF9864198F0BFE8D07DDACDEAC8"
["keyid"]=>
string(16) "BFE8D07DDACDEAC8"
["timestamp"]=>