From a0c4ad21b67c4d27678550508e049a0a24f89cad Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 2 Sep 2003 22:56:18 +1000 Subject: [PATCH] - markus@cvs.openbsd.org 2003/08/31 13:30:18 [gss-serv.c] correct string termination in parse_ename(); sxw@inf.ed.ac.uk --- ChangeLog | 5 ++++- gss-serv.c | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 262c8e3c1..442389a7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,9 @@ [session.c] call ssh_gssapi_storecreds conditionally from do_exec(); with sxw@inf.ed.ac.uk + - markus@cvs.openbsd.org 2003/08/31 13:30:18 + [gss-serv.c] + correct string termination in parse_ename(); sxw@inf.ed.ac.uk 20030829 - (bal) openbsd-compat/ clean up. Considate headers, add in Id on our @@ -941,4 +944,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.2926 2003/09/02 12:55:45 djm Exp $ +$Id: ChangeLog,v 1.2927 2003/09/02 12:56:18 djm Exp $ diff --git a/gss-serv.c b/gss-serv.c index 42718177d..8eb20e955 100644 --- a/gss-serv.c +++ b/gss-serv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gss-serv.c,v 1.1 2003/08/22 10:56:09 markus Exp $ */ +/* $OpenBSD: gss-serv.c,v 1.2 2003/08/31 13:30:18 markus Exp $ */ /* * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. @@ -178,9 +178,10 @@ ssh_gssapi_parse_ename(Gssctxt *ctx, gss_buffer_t ename, gss_buffer_t name) if (ename->length < offset+name->length) return GSS_S_FAILURE; - name->value = xmalloc(name->length); + name->value = xmalloc(name->length+1); memcpy(name->value,tok+offset,name->length); - + ((char *)name->value)[name->length] = 0; + return GSS_S_COMPLETE; }