summaryrefslogtreecommitdiff
path: root/gss-genr.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-03-26 14:19:21 +1100
committerDamien Miller <djm@mindrot.org>2006-03-26 14:19:21 +1100
commit07d86bec5eeaf19fe33dca99c8ebcbe9a77c3938 (patch)
tree098295eee2d7ec7b116b0db3ac4b580713dd5ab0 /gss-genr.c
parent7cd4579eb3c5afd22ae24436fd2611cd3aa0150a (diff)
- djm@cvs.openbsd.org 2006/03/25 00:05:41
[auth-bsdauth.c auth-skey.c auth.c auth2-chall.c channels.c] [clientloop.c deattack.c gss-genr.c kex.c key.c misc.c moduli.c] [monitor.c monitor_wrap.c packet.c scard.c sftp-server.c ssh-agent.c] [ssh-keyscan.c ssh.c sshconnect.c sshconnect2.c sshd.c uuencode.c] [xmalloc.c xmalloc.h] introduce xcalloc() and xasprintf() failure-checked allocations functions and use them throughout openssh xcalloc is particularly important because malloc(nmemb * size) is a dangerous idiom (subject to integer overflow) and it is time for it to die feedback and ok deraadt@
Diffstat (limited to 'gss-genr.c')
-rw-r--r--gss-genr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gss-genr.c b/gss-genr.c
index 8d75ee5c7..9cedfcdc3 100644
--- a/gss-genr.c
+++ b/gss-genr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-genr.c,v 1.7 2006/03/20 04:07:49 djm Exp $ */ 1/* $OpenBSD: gss-genr.c,v 1.8 2006/03/25 00:05:41 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.
@@ -135,9 +135,7 @@ ssh_gssapi_last_error(Gssctxt *ctxt, OM_uint32 *major_status,
135void 135void
136ssh_gssapi_build_ctx(Gssctxt **ctx) 136ssh_gssapi_build_ctx(Gssctxt **ctx)
137{ 137{
138 *ctx = xmalloc(sizeof (Gssctxt)); 138 *ctx = xcalloc(1, sizeof (Gssctxt));
139 (*ctx)->major = 0;
140 (*ctx)->minor = 0;
141 (*ctx)->context = GSS_C_NO_CONTEXT; 139 (*ctx)->context = GSS_C_NO_CONTEXT;
142 (*ctx)->name = GSS_C_NO_NAME; 140 (*ctx)->name = GSS_C_NO_NAME;
143 (*ctx)->oid = GSS_C_NO_OID; 141 (*ctx)->oid = GSS_C_NO_OID;