(gss_adat): fix name allocation bug
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12359 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Johan Danielsson
					Johan Danielsson