From af2414aacc7dfb27ebde3f3372e8adbac1ff0cf9 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Mon, 25 May 1998 02:02:40 +0000 Subject: [PATCH] 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 --- src/lib/gssapi/generic/ChangeLog | 5 +++++ src/lib/gssapi/generic/util_buffer.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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); } -- 2.26.2