summaryrefslogtreecommitdiff
path: root/gss-serv.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-07-03 21:24:19 +1000
committerDamien Miller <djm@mindrot.org>2014-07-03 21:24:19 +1000
commite5c0d52ceb575c3db8c313e0b1aa3845943d7ba8 (patch)
tree38dd3c4459b009f696ae99a50b2186e4e1c3cf0e /gss-serv.c
parentc174a3b7c14e0d178c61219de2aa1110e209950c (diff)
- djm@cvs.openbsd.org 2014/07/03 03:34:09
[gss-serv.c session.c ssh-keygen.c] standardise on NI_MAXHOST for gethostname() string lengths; about 1/2 the cases were using it already. Fixes bz#2239 en passant
Diffstat (limited to 'gss-serv.c')
-rw-r--r--gss-serv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gss-serv.c b/gss-serv.c
index e61b37bec..5c599247b 100644
--- a/gss-serv.c
+++ b/gss-serv.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-serv.c,v 1.26 2014/02/26 20:28:44 djm Exp $ */ 1/* $OpenBSD: gss-serv.c,v 1.27 2014/07/03 03:34:09 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.
@@ -97,13 +97,13 @@ static OM_uint32
97ssh_gssapi_acquire_cred(Gssctxt *ctx) 97ssh_gssapi_acquire_cred(Gssctxt *ctx)
98{ 98{
99 OM_uint32 status; 99 OM_uint32 status;
100 char lname[MAXHOSTNAMELEN]; 100 char lname[NI_MAXHOST];
101 gss_OID_set oidset; 101 gss_OID_set oidset;
102 102
103 gss_create_empty_oid_set(&status, &oidset); 103 gss_create_empty_oid_set(&status, &oidset);
104 gss_add_oid_set_member(&status, ctx->oid, &oidset); 104 gss_add_oid_set_member(&status, ctx->oid, &oidset);
105 105
106 if (gethostname(lname, MAXHOSTNAMELEN)) { 106 if (gethostname(lname, sizeof(lname))) {
107 gss_release_oid_set(&status, &oidset); 107 gss_release_oid_set(&status, &oidset);
108 return (-1); 108 return (-1);
109 } 109 }