summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2003-08-31 13:30:19 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2003-08-31 13:30:19 +0000
commitc590c38b97e1a1ada167fac7f76ee80daf1239db (patch)
tree5e54871efcd7bbbf0199397957b9d357dae114be
parent0c85a5a50c42139bc85738d2ed7b9bff2fbbe42c (diff)
correct string termination in parse_ename(); sxw@inf.ed.ac.uk
-rw-r--r--usr.bin/ssh/gss-serv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/gss-serv.c b/usr.bin/ssh/gss-serv.c
index 42718177d9f..8eb20e9557e 100644
--- a/usr.bin/ssh/gss-serv.c
+++ b/usr.bin/ssh/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;
}