Blame SOURCES/Tolerate-NULL-pointers-in-gp_same.patch

68bf20
From 05a2677920f0240ea302e67d699546665687dd14 Mon Sep 17 00:00:00 2001
1f3433
From: Robbie Harwood <rharwood@redhat.com>
1f3433
Date: Tue, 13 Jun 2017 14:22:44 -0400
1f3433
Subject: [PATCH] Tolerate NULL pointers in gp_same
1f3433
1f3433
Fixes potential NULL derefs of program names
1f3433
1f3433
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
1f3433
Reviewed-by: Simo Sorce <simo@redhat.com>
1f3433
Merges: #195
1f3433
(cherry picked from commit afe4c2fe6f7f939df914959dda11131bd80ccec6)
1f3433
---
1f3433
 proxy/src/gp_util.c | 3 +--
1f3433
 1 file changed, 1 insertion(+), 2 deletions(-)
1f3433
1f3433
diff --git a/proxy/src/gp_util.c b/proxy/src/gp_util.c
1f3433
index f158b84..5442992 100644
1f3433
--- a/proxy/src/gp_util.c
1f3433
+++ b/proxy/src/gp_util.c
1f3433
@@ -12,10 +12,9 @@
1f3433
 
1f3433
 bool gp_same(const char *a, const char *b)
1f3433
 {
1f3433
-    if ((a == b) || strcmp(a, b) == 0) {
1f3433
+    if (a == b || (a && b && strcmp(a, b) == 0)) {
1f3433
         return true;
1f3433
     }
1f3433
-
1f3433
     return false;
1f3433
 }
1f3433