From d0ae5002f1f08ae88e1178b1b17643c1c84a35c4 Mon Sep 17 00:00:00 2001 From: Thilo Raufeisen Date: Fri, 25 Nov 2005 14:31:36 +0000 Subject: [PATCH] fixed segfault during import, when keyring is not writeable --- gnupg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnupg.c b/gnupg.c index d630074..4f5872f 100644 --- a/gnupg.c +++ b/gnupg.c @@ -1354,7 +1354,9 @@ PHP_FUNCTION(gnupg_import){ add_assoc_long (return_value, "secretunchanged", result->secret_unchanged); add_assoc_long (return_value, "newsignatures", result->new_signatures); add_assoc_long (return_value, "skippedkeys", result->skipped_new_keys); - add_assoc_string (return_value, "fingerprint", result->imports->fpr, 1); + if(result->imports && result->imports->fpr){ + add_assoc_string (return_value, "fingerprint", result->imports->fpr, 1); + } } /* }}} */