]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Use gssalloc_malloc for GSS error tokens
authorGreg Hudson <ghudson@mit.edu>
Wed, 8 Oct 2014 00:22:52 +0000 (20:22 -0400)
committerTom Yu <tlyu@mit.edu>
Tue, 10 Feb 2015 03:12:58 +0000 (22:12 -0500)
In kg_accept_krb5, use gssalloc_malloc when allocating space for the
error token, since it will be freed with gssalloc_free.  Using malloc
can cause heap corruption on Windows.  This bug was masked by #1445
before 1.12.

(cherry picked from commit 68cfc8b4e6338b78dce5a960ce47974a73906fac)

ticket: 8129 (new)
version_fixed: 1.12.3
status: resolved

src/lib/gssapi/krb5/accept_sec_context.c

index 82f03b7cc60eb7b5a5765a37f2f9e09c2b3a05ee..e824e0badfec2ec6150591d033ed52f9ed17404d 100644 (file)
@@ -1238,7 +1238,7 @@ fail:
         toktype = KG_TOK_CTX_ERROR;
 
         token.length = g_token_size(mech_used, tmsglen);
-        token.value = (unsigned char *) xmalloc(token.length);
+        token.value = gssalloc_malloc(token.length);
         if (!token.value)
             goto done;