diff options
author | James Booth <boothj5@gmail.com> | 2015-09-01 21:08:23 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-09-01 21:08:23 +0100 |
commit | 4d18c5ff52deb3f4abd8e2029a0be0ba0a30cfbf (patch) | |
tree | 9e0e5fc1b4db2b64051d6a2990f24f0afed1b472 /src/pgp/gpg.c | |
parent | 53035f5e4cdb1157478ab6602647e1feb67dbe30 (diff) | |
download | profani-tty-4d18c5ff52deb3f4abd8e2029a0be0ba0a30cfbf.tar.gz |
PGP: Added null check for passphrase_attempt
Diffstat (limited to 'src/pgp/gpg.c')
-rw-r--r-- | src/pgp/gpg.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c index 13a4608f..3d6bdc09 100644 --- a/src/pgp/gpg.c +++ b/src/pgp/gpg.c @@ -581,7 +581,9 @@ p_gpg_sign(const char * const str, const char * const fp) gpgme_free(signed_str); } - passphrase = strdup(passphrase_attempt); + if (passphrase_attempt) { + passphrase = strdup(passphrase_attempt); + } return result; } @@ -710,7 +712,9 @@ p_gpg_decrypt(const char * const cipher) } gpgme_free(plain_str); - passphrase = strdup(passphrase_attempt); + if (passphrase_attempt) { + passphrase = strdup(passphrase_attempt); + } return result; } |