Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-distro / recipes-security / gssproxy / files / Tolerate-NULL-pointers-in-gp_same.patch
1 From 05a2677920f0240ea302e67d699546665687dd14 Mon Sep 17 00:00:00 2001
2 From: Robbie Harwood <rharwood@redhat.com>
3 Date: Tue, 13 Jun 2017 14:22:44 -0400
4 Subject: [PATCH] Tolerate NULL pointers in gp_same
5
6 Fixes potential NULL derefs of program names
7
8 Signed-off-by: Robbie Harwood <rharwood@redhat.com>
9 Reviewed-by: Simo Sorce <simo@redhat.com>
10 Merges: #195
11 (cherry picked from commit afe4c2fe6f7f939df914959dda11131bd80ccec6)
12 ---
13  proxy/src/gp_util.c | 3 +--
14  1 file changed, 1 insertion(+), 2 deletions(-)
15
16 diff --git a/proxy/src/gp_util.c b/proxy/src/gp_util.c
17 index f158b84..5442992 100644
18 --- a/proxy/src/gp_util.c
19 +++ b/proxy/src/gp_util.c
20 @@ -12,10 +12,9 @@
21  
22  bool gp_same(const char *a, const char *b)
23  {
24 -    if ((a == b) || strcmp(a, b) == 0) {
25 +    if (a == b || (a && b && strcmp(a, b) == 0)) {
26          return true;
27      }
28 -
29      return false;
30  }
31