From d91aa65d1610cfdb19a0730a566bf34e90e6c1b1 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Wed, 7 Nov 2001 13:48:07 +0000 Subject: [PATCH] * gss-misc.c (recv_token): Do not attempt to malloc 0 bytes git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13960 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gss-sample/ChangeLog | 6 +++++- src/appl/gss-sample/gss-misc.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/appl/gss-sample/ChangeLog b/src/appl/gss-sample/ChangeLog index 5a5cf81d3..7eedd70e6 100644 --- a/src/appl/gss-sample/ChangeLog +++ b/src/appl/gss-sample/ChangeLog @@ -1,6 +1,10 @@ +2001-11-07 Ezra Peisach + + * gss-misc.c (recv_token): Do not attempt to malloc 0 bytes. + 2001-11-01 Sam Hartman - * gss-server.c gss-client.c: ONly free buffers returned from + * gss-server.c gss-client.c: Only free buffers returned from GSSAPI using gss_release_buffer * gss-client.c (client_establish_context): Trailing null should diff --git a/src/appl/gss-sample/gss-misc.c b/src/appl/gss-sample/gss-misc.c index 78e5d2fd8..0fc6d9295 100644 --- a/src/appl/gss-sample/gss-misc.c +++ b/src/appl/gss-sample/gss-misc.c @@ -214,7 +214,7 @@ int recv_token(s, flags, tok) } tok->length = ntohl(tok->length); - tok->value = (char *) malloc(tok->length); + tok->value = (char *) malloc(tok->length ? tok->length : 1); if (tok->length && tok->value == NULL) { if (display_file) fprintf(display_file, -- 2.26.2