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

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