gssproxy/Tolerate-NULL-pointers-in-gp_same.patch
2017-06-19 15:40:50 +00:00

32 lines
862 B
Diff

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