[gnome-build-meta/mcatanzaro/gssproxy-patch] Add gssproxy patch to hopefully fix a crash




commit cee3a96e3e9b06888005182dac3829af120ad6ce
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Thu Oct 13 13:51:56 2022 -0500

    Add gssproxy patch to hopefully fix a crash
    
    Patch from https://github.com/gssapi/gssproxy/pull/68
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-build-meta/-/merge_requests/1823>

 elements/sdk/gssproxy.bst |  2 ++
 files/gssproxy/68.patch   | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
---
diff --git a/elements/sdk/gssproxy.bst b/elements/sdk/gssproxy.bst
index 5da6d456a..32c57dd0a 100644
--- a/elements/sdk/gssproxy.bst
+++ b/elements/sdk/gssproxy.bst
@@ -4,6 +4,8 @@ sources:
 - kind: tar
   url: github_files:gssapi/gssproxy/releases/download/v0.9.1/gssproxy-0.9.1.tar.gz
   ref: ebc355c1495db96e3591574f32b9464fcfbf73381ce8fcb397cdede220167dc4
+- kind: patch
+  path: files/gssproxy/68.patch
 
 build-depends:
 - freedesktop-sdk.bst:public-stacks/buildsystem-autotools.bst
diff --git a/files/gssproxy/68.patch b/files/gssproxy/68.patch
new file mode 100644
index 000000000..7daca7b4d
--- /dev/null
+++ b/files/gssproxy/68.patch
@@ -0,0 +1,33 @@
+From 99efb7fb681d6c6e3acb6508cbc42fb276b04c20 Mon Sep 17 00:00:00 2001
+From: Simo Sorce <simo redhat com>
+Date: Thu, 13 Oct 2022 14:14:05 -0400
+Subject: [PATCH] Guard against NULL remote credentials
+
+In some rare cases is may happen that we fail to init
+cred_handle->remote, in this case we need to guard xdr_free() because
+this function does not handle NULL pointers gracefully like free() does.
+
+Signed-off-by: Simo Sorce <simo redhat com>
+---
+ src/mechglue/gpp_init_sec_context.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/mechglue/gpp_init_sec_context.c b/src/mechglue/gpp_init_sec_context.c
+index bb878df..f328993 100644
+--- a/src/mechglue/gpp_init_sec_context.c
++++ b/src/mechglue/gpp_init_sec_context.c
+@@ -171,9 +171,11 @@ OM_uint32 gssi_init_sec_context(OM_uint32 *minor_status,
+                                    &out_cred);
+         if (maj == GSS_S_COMPLETE || maj == GSS_S_CONTINUE_NEEDED) {
+             if (out_cred) {
+-                xdr_free((xdrproc_t)xdr_gssx_cred,
+-                         (char *)cred_handle->remote);
+-                free(cred_handle->remote);
++                if (cred_handle->remote) {
++                    xdr_free((xdrproc_t)xdr_gssx_cred,
++                             (char *)cred_handle->remote);
++                    free(cred_handle->remote);
++                }
+                 cred_handle->remote = out_cred;
+                 out_cred = NULL;
+                 /* failuire is not fatal */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]