[Pkg-nagios-devel] Bug#396337: [PATCH] Off-by-one in NAGIOS check_tcp.c

Martin Blapp mb at imp.ch
Tue Oct 31 11:59:21 CET 2006


--- ./check_tcp.c    2004-12-30 01:41:40.000000000 +0100
+++ ./check_tcp.c       2006-10-31 11:56:59.000000000 +0100
@@ -310,7 +310,7 @@
                 memset (buffer, '\0', MAXBUF);
                 /* watch for the expect string */
                 while ((i = my_recv ()) > 0) {
-                       buffer[i] = '\0';
+                       buffer[i+1] = '\0';
                         asprintf (&status, "%s%s", status, buffer);
                         if (buffer[i-2] == '\r' && buffer[i-1] == '\n')
                                 break;

Martin Blapp, <mb at imp.ch> <mbr at FreeBSD.org>
------------------------------------------------------------------
ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH
Phone: +41 61 826 93 00 Fax: +41 61 826 93 01
PGP: <finger -l mbr at freebsd.org>
PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E
------------------------------------------------------------------




More information about the Pkg-nagios-devel mailing list