summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2008-09-24 21:20:44 +0000
committerdes <des@FreeBSD.org>2008-09-24 21:20:44 +0000
commitab1a43cf51b32e1731821844a7b2e26ff085322c (patch)
treecfee3428b4a95708db1e079ab2aa5bd50f9ed962 /crypto
parent20ecbed7628d2f76d15075b85725e723ff904180 (diff)
downloadFreeBSD-src-ab1a43cf51b32e1731821844a7b2e26ff085322c.zip
FreeBSD-src-ab1a43cf51b32e1731821844a7b2e26ff085322c.tar.gz
MFV "xmalloc: zero size" fix.
MFC after: 1 week
Diffstat (limited to 'crypto')
-rw-r--r--crypto/openssh/sshconnect2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c
index 389bec9..067c875 100644
--- a/crypto/openssh/sshconnect2.c
+++ b/crypto/openssh/sshconnect2.c
@@ -386,8 +386,9 @@ input_userauth_banner(int type, u_int32_t seq, void *ctxt)
if (options.log_level >= SYSLOG_LEVEL_INFO) {
if (len > 65536)
len = 65536;
- msg = xmalloc(len * 4); /* max expansion from strnvis() */
+ msg = xmalloc(len * 4 + 1); /* max expansion from strnvis() */
strnvis(msg, raw, len * 4, VIS_SAFE|VIS_OCTAL);
+ msg[len*4] = '\0';
fprintf(stderr, "%s", msg);
xfree(msg);
}
OpenPOWER on IntegriCloud