summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--gss-genr.c9
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 33abee3b8..360cf61b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,11 @@
12 - dtucker@cvs.openbsd.org 2006/04/02 08:34:52 12 - dtucker@cvs.openbsd.org 2006/04/02 08:34:52
13 [ssh-keysign.c] 13 [ssh-keysign.c]
14 sessionid can be 32 bytes now too when sha256 kex is used; ok djm@ 14 sessionid can be 32 bytes now too when sha256 kex is used; ok djm@
15 - djm@cvs.openbsd.org 2006/04/03 07:10:38
16 [gss-genr.c]
17 GSSAPI buffers shouldn't be nul-terminated, spotted in bugzilla #1066
18 by dleonard AT vintela.com. use xasprintf() to simplify code while in
19 there; "looks right" deraadt@
15 20
1620060421 2120060421
17 - (djm) [Makefile.in configure.ac session.c sshpty.c] 22 - (djm) [Makefile.in configure.ac session.c sshpty.c]
@@ -4523,4 +4528,4 @@
4523 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 4528 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
4524 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 4529 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
4525 4530
4526$Id: ChangeLog,v 1.4305 2006/04/23 02:05:32 djm Exp $ 4531$Id: ChangeLog,v 1.4306 2006/04/23 02:05:46 djm Exp $
diff --git a/gss-genr.c b/gss-genr.c
index 4c10f1aab..3d630ab82 100644
--- a/gss-genr.c
+++ b/gss-genr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-genr.c,v 1.9 2006/03/25 22:22:43 djm Exp $ */ 1/* $OpenBSD: gss-genr.c,v 1.10 2006/04/03 07:10:38 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. 4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -205,10 +205,11 @@ OM_uint32
205ssh_gssapi_import_name(Gssctxt *ctx, const char *host) 205ssh_gssapi_import_name(Gssctxt *ctx, const char *host)
206{ 206{
207 gss_buffer_desc gssbuf; 207 gss_buffer_desc gssbuf;
208 char *val;
208 209
209 gssbuf.length = sizeof("host@") + strlen(host); 210 xasprintf(&val, "host@%s", host);
210 gssbuf.value = xmalloc(gssbuf.length); 211 gssbuf.value = val;
211 snprintf(gssbuf.value, gssbuf.length, "host@%s", host); 212 gssbuf.length = strlen(gssbuf.value);
212 213
213 if ((ctx->major = gss_import_name(&ctx->minor, 214 if ((ctx->major = gss_import_name(&ctx->minor,
214 &gssbuf, GSS_C_NT_HOSTBASED_SERVICE, &ctx->name))) 215 &gssbuf, GSS_C_NT_HOSTBASED_SERVICE, &ctx->name)))