From: Theodore Tso Date: Mon, 25 May 1998 02:02:40 +0000 (+0000) Subject: util_buffer.c (g_make_string_buffer): Don't include the trailing X-Git-Tag: krb5-1.1-beta1~713 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=af2414aacc7dfb27ebde3f3372e8adbac1ff0cf9;p=krb5.git util_buffer.c (g_make_string_buffer): Don't include the trailing NULL of the string in the gss buffer's length. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10580 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/generic/ChangeLog b/src/lib/gssapi/generic/ChangeLog index a71aeb1cd..84efdd75a 100644 --- a/src/lib/gssapi/generic/ChangeLog +++ b/src/lib/gssapi/generic/ChangeLog @@ -1,3 +1,8 @@ +Sun May 24 22:01:29 1998 Theodore Y. Ts'o + + * util_buffer.c (g_make_string_buffer): Don't include the trailing + NULL of the string in the gss buffer's length. + 1998-05-18 Theodore Ts'o * util_ordering.c (g_order_free): diff --git a/src/lib/gssapi/generic/util_buffer.c b/src/lib/gssapi/generic/util_buffer.c index e715834d9..77cb2eb2f 100644 --- a/src/lib/gssapi/generic/util_buffer.c +++ b/src/lib/gssapi/generic/util_buffer.c @@ -35,9 +35,9 @@ int g_make_string_buffer(str, buffer) const char *str; gss_buffer_t buffer; { - buffer->length = strlen(str)+1; + buffer->length = strlen(str); - if ((buffer->value = (void *) xmalloc(buffer->length)) == NULL) { + if ((buffer->value = (void *) xmalloc(buffer->length + 1)) == NULL) { buffer->length = 0; return(0); }