]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Use gssalloc_malloc for GSS error tokens 217/head
authorGreg Hudson <ghudson@mit.edu>
Wed, 8 Oct 2014 00:22:52 +0000 (20:22 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 9 Oct 2014 15:35:51 +0000 (11:35 -0400)
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.

ticket: 8024 (new)
target_version: 1.13.1
tags: pullup

src/lib/gssapi/krb5/accept_sec_context.c

index 45e18412b90dd78799693ef1076a6dcf3e5da9f4..014d24bdae8d188d4b848eb69074c60f01597612 100644 (file)
@@ -1243,7 +1243,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;