summaryrefslogtreecommitdiff
path: root/0002-getcert-add-NULL-check-to-duplicate-string-compare.patch
blob: 217358d6fc840d9ff979a32f545644c19b27eca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From d9a773f709b42b6fe7d8816da656e5bee2afd641 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Tue, 30 Jan 2024 09:06:53 -0500
Subject: [PATCH 2/2] getcert: add NULL check to duplicate string compare

Fixes: https://www.pagure.io/certmonger/issue/269

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
---
 src/getcert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/getcert.c b/src/getcert.c
index 81b4bc8d..f5575bce 100644
--- a/src/getcert.c
+++ b/src/getcert.c
@@ -497,7 +497,7 @@ send_req(DBusMessage *req, int verbose)
 			printf(_("No response received from %s service.\n"),
 			       CM_DBUS_NAME);
 		}
-		if (strcmp(err.name, "org.fedorahosted.certmonger.duplicate") == 0) {
+		if ((err.name != NULL) && strcmp(err.name, "org.fedorahosted.certmonger.duplicate") == 0) {
 			exit(2);
 		}
 		exit(1);
-- 
2.42.0