krb5 commit [krb5-1.12]: Use gssalloc_malloc for GSS error tokens

Tom Yu tlyu at mit.edu
Mon Feb 9 22:27:32 EST 2015


https://github.com/krb5/krb5/commit/7e6146a9b3dc498cc6d3f48ae1fbb04161516ebd
commit 7e6146a9b3dc498cc6d3f48ae1fbb04161516ebd
Author: Greg Hudson <ghudson at mit.edu>
Date:   Tue Oct 7 20:22:52 2014 -0400

    Use gssalloc_malloc for GSS error tokens
    
    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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c
index 82f03b7..e824e0b 100644
--- a/src/lib/gssapi/krb5/accept_sec_context.c
+++ b/src/lib/gssapi/krb5/accept_sec_context.c
@@ -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;
 


More information about the cvs-krb5 mailing list