mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2026-02-05 05:41:34 +00:00
Fix GH-37: decryption of an encrypted empty string returns false (#50)
Closes GH-50
This commit is contained in:
parent
d3bbfee186
commit
c365ff0835
4 changed files with 34 additions and 5 deletions
10
gnupg.c
10
gnupg.c
|
|
@ -1705,11 +1705,13 @@ PHP_FUNCTION(gnupg_decrypt)
|
|||
return;
|
||||
}
|
||||
userret = gpgme_data_release_and_get_mem(out, &ret_size);
|
||||
|
||||
gpgme_data_release(in);
|
||||
PHPC_CSTRL_RETVAL(userret, ret_size);
|
||||
free(userret);
|
||||
if (ret_size < 1) {
|
||||
RETVAL_FALSE;
|
||||
if (userret != NULL) {
|
||||
PHPC_CSTRL_RETVAL(userret, ret_size);
|
||||
free(userret);
|
||||
} else {
|
||||
PHPC_CSTR_EMPTY_RETVAL();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue