-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gssproxy patch to hopefully fix a crash
Patch from gssapi/gssproxy#68 Part-of: <https://gitlab.gnome.org/GNOME/gnome-build-meta/-/merge_requests/1823>
- Loading branch information
1 parent
82e8813
commit cee3a96
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ |