vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Blob Blame History Raw
diff -up openssh-5.1p1/sshconnect2.c.bannerlen openssh-5.1p1/sshconnect2.c
--- openssh-5.1p1/sshconnect2.c.bannerlen	2008-07-23 19:18:15.000000000 +0200
+++ openssh-5.1p1/sshconnect2.c	2008-07-31 11:16:51.000000000 +0200
@@ -387,8 +387,9 @@ input_userauth_banner(int type, u_int32_
 	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);
 	}