[krbdev.mit.edu #8735] GSS buffer set failures on Windows due to gssalloc_realloc()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[krbdev.mit.edu #8735] GSS buffer set failures on Windows due to gssalloc_realloc()

Greg Hudson via RT-2
Thanks for the report.  The MSDN documentation for HeapReAlloc() does
say that the input pointer "is returned by an earlier call to the
HeapAlloc or HeapReAlloc function" so I guess it is within its rights
to fail on a NULL input, unlike C's realloc().

Do you have a patch that you have tested for this issue?  My initial
inclination is to change the Windows definition of gssalloc_realloc()
(in gssapi_alloc.h) to:

static inline void *
gssalloc_realloc(void *value, size_t size)
{
    /* Unlike realloc(), HeapReAlloc() does not work on NULL. */
    if (value == NULL)
        return HeapAlloc(GetProcessHeap(), 0, size);
    return HeapReAlloc(GetProcessHeap(), 0, value, size);
}
_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs