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

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