summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2008-12-09 04:32:22 +0000
committerdjm <djm@openbsd.org>2008-12-09 04:32:22 +0000
commit5e03c2f99de2b923a009fbcd3975d0cb057880c4 (patch)
tree9f45454129d72e9669c9ffa3f0ab854e8d0ba852
parentchannel_print_adm_permitted_opens() should deal with all the printing (diff)
downloadwireguard-openbsd-5e03c2f99de2b923a009fbcd3975d0cb057880c4.tar.xz
wireguard-openbsd-5e03c2f99de2b923a009fbcd3975d0cb057880c4.zip
replace by-hand string building with xasprinf(); ok deraadt@
-rw-r--r--usr.bin/ssh/auth2-chall.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/ssh/auth2-chall.c b/usr.bin/ssh/auth2-chall.c
index eef7b203465..4f0c3667693 100644
--- a/usr.bin/ssh/auth2-chall.c
+++ b/usr.bin/ssh/auth2-chall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-chall.c,v 1.33 2007/09/21 08:15:29 djm Exp $ */
+/* $OpenBSD: auth2-chall.c,v 1.34 2008/12/09 04:32:22 djm Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2001 Per Allansson. All rights reserved.
@@ -236,7 +236,7 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
{
Authctxt *authctxt = ctxt;
KbdintAuthctxt *kbdintctxt;
- int authenticated = 0, res, len;
+ int authenticated = 0, res;
u_int i, nresp;
char **response = NULL, *method;
@@ -285,11 +285,7 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
break;
}
- len = strlen("keyboard-interactive") + 2 +
- strlen(kbdintctxt->device->name);
- method = xmalloc(len);
- snprintf(method, len, "keyboard-interactive/%s",
- kbdintctxt->device->name);
+ xasprintf(&method, "keyboard-interactive/%s", kbdintctxt->device->name);
if (!authctxt->postponed) {
if (authenticated) {