[PATCH] userauth_gssapi_cleanup: supported mechs should be freed via gss_release_oid_set

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

 




https://bugzilla.mindrot.org/show_bug.cgi?id=2982

Attached is a small patch that should be applied before the 8.0 release.

It fixes a problem with a recent patch (authored by me), where gssapi_cleanup was introduced and gssapi resources are freed.

It turns out that the supported_mechs should not be just freed but instead freed through gss_release_oid_set.

The error is probably irrelevant in the *ix/bsd environments, but turned out to be an error under Windows if a dynamic lib (gssapi.dll) from MIT Kerbereros is used.

Thanks


Markus Schmidt
diff --git a/sshconnect2.c b/sshconnect2.c
index dffee90..e4f345e 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -749,14 +749,15 @@ userauth_gssapi(struct ssh *ssh)
 static void
 userauth_gssapi_cleanup(struct ssh *ssh)
 {
+	OM_uint32 ms;
+
 	Authctxt *authctxt = (Authctxt *)ssh->authctxt;
 	Gssctxt *gssctxt = (Gssctxt *)authctxt->methoddata;
 
 	ssh_gssapi_delete_ctx(&gssctxt);
 	authctxt->methoddata = NULL;
 
-	free(authctxt->gss_supported_mechs);
-	authctxt->gss_supported_mechs = NULL;
+	gss_release_oid_set(&ms, &authctxt->gss_supported_mechs);
 }
 
 static OM_uint32
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

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

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux