Blob Blame History Raw
From c306d5e8681990f2aa9a56bca2866bd47d1c784f Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Tue, 10 Nov 2015 13:22:21 +0100
Subject: [PATCH] a-a-s-p-data: fix segfault if GPGKeysDir isn't configured

Related to #1591141

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/daemon/abrt-action-save-package-data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/daemon/abrt-action-save-package-data.c b/src/daemon/abrt-action-save-package-data.c
index ef2007ee..ef492c28 100644
--- a/src/daemon/abrt-action-save-package-data.c
+++ b/src/daemon/abrt-action-save-package-data.c
@@ -88,7 +88,7 @@ static void load_gpg_keys(void)
     }
 
     const char *gpg_keys_dir = get_map_string_item_or_NULL(settings, "GPGKeysDir");
-    if (strcmp(gpg_keys_dir, "") != 0)
+    if (gpg_keys_dir != NULL && strcmp(gpg_keys_dir, "") != 0)
     {
         log_debug("Reading gpg keys from '%s'", gpg_keys_dir);
         GList *gpg_files = get_file_list(gpg_keys_dir, NULL /* we don't care about the file ext */);
-- 
2.17.1