summaryrefslogtreecommitdiff
path: root/sshconnect2.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2008-09-29 21:59:13 +0000
committerColin Watson <cjwatson@debian.org>2008-09-29 21:59:13 +0000
commit62a83c59546b087604a889daf3f37b8a894dc7f0 (patch)
tree6a806156888906ea593630c04b0d47e10b6823f8 /sshconnect2.c
parent55af36878de8286f391aaaa5b8efbb567743aec8 (diff)
Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
#497026).
Diffstat (limited to 'sshconnect2.c')
-rw-r--r--sshconnect2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index 18cbbd9f9..185e7b204 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -441,8 +441,9 @@ input_userauth_banner(int type, u_int32_t seq, void *ctxt)
441 if (options.log_level >= SYSLOG_LEVEL_INFO) { 441 if (options.log_level >= SYSLOG_LEVEL_INFO) {
442 if (len > 65536) 442 if (len > 65536)
443 len = 65536; 443 len = 65536;
444 msg = xmalloc(len * 4); /* max expansion from strnvis() */ 444 msg = xmalloc(len * 4 + 1); /* max expansion from strnvis() */
445 strnvis(msg, raw, len * 4, VIS_SAFE|VIS_OCTAL); 445 strnvis(msg, raw, len * 4 + 1, VIS_SAFE|VIS_OCTAL);
446 msg[len*4] = '\0';
446 fprintf(stderr, "%s", msg); 447 fprintf(stderr, "%s", msg);
447 xfree(msg); 448 xfree(msg);
448 } 449 }