Skip to content

Commit

Permalink
Add gssproxy patch to hopefully fix a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
mcatanzaro committed Oct 13, 2022
1 parent 82e8813 commit cee3a96
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions elements/sdk/gssproxy.bst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions files/gssproxy/68.patch
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit cee3a96

Please sign in to comment.