From bc6e02716a52855e88262d5aec044c004f3fef6c Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Fri, 13 Jun 2003 12:08:21 +0000 Subject: [PATCH] (gss_adat): fix name allocation bug git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12359 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftp/gssapi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appl/ftp/ftp/gssapi.c b/appl/ftp/ftp/gssapi.c index 76c1a33e3..e705dfed9 100644 --- a/appl/ftp/ftp/gssapi.c +++ b/appl/ftp/ftp/gssapi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998 - 2002 Kungliga Tekniska Högskolan + * Copyright (c) 1998 - 2003 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -219,12 +219,13 @@ gss_adat(void *app_data, void *buf, size_t len) gss_release_buffer(&min_stat, &export_name); goto out; } - name = realloc(export_name.value, export_name.length + 1); + name = malloc(export_name.length + 1); if(name == NULL) { reply(500, "Out of memory"); gss_release_buffer(&min_stat, &export_name); goto out; } + memcpy(name, export_name.value, export_name.length); name[export_name.length] = '\0'; gss_release_buffer(&min_stat, &export_name); d->client_name = name;