k5buf_to_gss was used in only one place (generic_gss_oid_to_str),
where we want to include the terminating null byte in the GSS buffer.
Remove that assumption from the helper, and instead explicitly append
the null byte to the buffer before translating.
{
OM_uint32 status = GSS_S_COMPLETE;
char *bp = krb5int_buf_data(input_k5buf);
- output_buffer->length = krb5int_buf_len(input_k5buf)+1;
+ output_buffer->length = krb5int_buf_len(input_k5buf);
#if defined(_WIN32) || defined(DEBUG_GSSALLOC)
if (output_buffer->length > 0) {
output_buffer->value = gssalloc_malloc(output_buffer->length);
OM_uint32 number;
OM_uint32 i;
unsigned char *cp;
- char *bp;
struct k5buf buf;
if (minor_status != NULL)
number = 0;
}
}
- krb5int_buf_add(&buf, "}");
- bp = krb5int_buf_data(&buf);
- if (bp == NULL) {
+ krb5int_buf_add_len(&buf, "}\0", 2);
+ if (krb5int_buf_data(&buf) == NULL) {
*minor_status = ENOMEM;
return(GSS_S_FAILURE);
}