Skip Menu |
 

Subject: potential null dereference in gss mechglue
Date: Fri, 5 Nov 2010 19:07:03 -0400
From: "Arlene Berry" <aberry@likewise.com>
To: <krb5-bugs@mit.edu>
Download (untitled) / with headers
text/plain 1.5KiB
In src/lib/gssapi/mechglue/g_canon_name.c in gss_canonicalize_name in
the allocation_failure section out_union is dereferenced without first
checking whether it was allocated.

--- src/lib/gssapi/mechglue/g_canon_name.c (revision 52314)
+++ src/lib/gssapi/mechglue/g_canon_name.c (revision 52315)
@@ -153,14 +153,17 @@
allocation_failure:
/* do not delete the src name external name format */
if (output_name) {
- if (out_union->external_name) {
- if (out_union->external_name->value)
- free(out_union->external_name->value);
- free(out_union->external_name);
+ if (out_union)
+ {
+ if (out_union->external_name) {
+ if (out_union->external_name->value)
+
free(out_union->external_name->value);
+ free(out_union->external_name);
+ }
+ if (out_union->name_type)
+ (void) gss_release_oid(minor_status,
+ &out_union->name_type);
}
- if (out_union->name_type)
- (void) gss_release_oid(minor_status,
- &out_union->name_type);

dest_union = out_union;
} else
@@ -171,16 +174,18 @@
* applies for both src and dest which ever is being used for
output
*/

- if (dest_union->mech_name) {
- (void) gssint_release_internal_name(minor_status,
+ if (dest_union)
+ {
+ if (dest_union->mech_name) {
+ (void)
gssint_release_internal_name(minor_status,
dest_union->mech_type,
&dest_union->mech_name);
+ }
+
+ if (dest_union->mech_type)
+ (void) gss_release_oid(minor_status,
&dest_union->mech_type);
}

- if (dest_union->mech_type)
- (void) gss_release_oid(minor_status,
&dest_union->mech_type);
-
-
if (output_name)
free(out_union);
From: ghudson@mit.edu
Subject: SVN Commit

Tighten up the error handling in the mechglue's gss_canonicalize_name,
eliminating a null pointer dereference in the (unlikely) case that
allocation of out_union fails. Reported by aberry@likewise.com.


https://github.com/krb5/krb5/commit/4d6dc27a5bf3c69ffecec35d32b816d654e1c970
Commit By: ghudson
Revision: 24592
Changed Files:
U trunk/src/lib/gssapi/mechglue/g_canon_name.c