summaryrefslogtreecommitdiff
path: root/sshconnect2.c
diff options
context:
space:
mode:
authordjm <djm>2008-11-03 08:22:09 +0000
committerdjm <djm>2008-11-03 08:22:09 +0000
commit33432c78043ce831716d6a447feb0b7fcc240a1c (patch)
treedbd74a7ba22681eb6b27024e6f335f87e1eb46ed /sshconnect2.c
parent88d823731742bfb97c585d20244016474e15f0e7 (diff)
downloadopenssh-33432c78043ce831716d6a447feb0b7fcc240a1c.tar.gz
aadt@cvs.openbsd.org 2008/10/03 23:56:28
[sshconnect2.c] Repair strnvis() buffersize of 4*n+1, with termination gauranteed by the function. spotted by des@freebsd, who commited an incorrect fix to the freebsd tree and (as is fairly typical) did not report the problem to us. But this fix is correct. ok djm
Diffstat (limited to 'sshconnect2.c')
-rw-r--r--sshconnect2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index 1a8f3907..fe9285f1 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.167 2008/07/31 14:48:28 markus Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.168 2008/10/03 23:56:28 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -386,8 +386,8 @@ input_userauth_banner(int type, u_int32_t seq, void *ctxt)
if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO) {
if (len > 65536)
len = 65536;
- msg = xmalloc(len * 4); /* max expansion from strnvis() */
- strnvis(msg, raw, len * 4, VIS_SAFE|VIS_OCTAL);
+ msg = xmalloc(len * 4 + 1); /* max expansion from strnvis() */
+ strnvis(msg, raw, len * 4 + 1, VIS_SAFE|VIS_OCTAL);
fprintf(stderr, "%s", msg);
xfree(msg);
}