[checkmk-commits] Check_MK Git: check_mk: check_icmp: remove buffer overflow on do_output_char

git version control git at mathias-kettner.de
Sun Nov 11 00:20:31 CET 2012


Module: check_mk
Branch: master
Commit: fd9e0664b51d562c58f52275f3195dc3844a3dbd
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd9e0664b51d562c58f52275f3195dc3844a3dbd

Author: Andreas Boesl <ab at mathias-kettner.de>
Date:   Sun Nov 11 00:19:49 2012 +0100

check_icmp: remove buffer overflow on do_output_char

---

 ChangeLog                   |    1 +
 livestatus/src/check_icmp.c |    9 ++-------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5924fce..cbc264d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -132,6 +132,7 @@
     Livestatus
     * FIX: comments_with_info in service table was always empty
     * FIX: check_icmp: fixed calculation of remaining length of output buffer
+    * FIX: check_icmp: removed possible buffer overflow on do_output_char()
     
     Livecheck
     * FIX: fixed problem with long plugin output
diff --git a/livestatus/src/check_icmp.c b/livestatus/src/check_icmp.c
index a2784e6..bb53fef 100644
--- a/livestatus/src/check_icmp.c
+++ b/livestatus/src/check_icmp.c
@@ -251,10 +251,6 @@ void do_output(int crash, char *format, ...)
         longjmp(exit_jmp, 1);
     }
 }
-void do_output_char(char c)
-{
-    *g_output_pointer++ = c;
-}
 
 static const char *
 get_icmp_error_msg(unsigned char icmp_type, unsigned char icmp_code)
@@ -845,7 +841,7 @@ finish(int sig)
 	}
 
 	/* iterate once more for pretty perfparse output */
-        do_output_char('|');
+	do_output(0, "|");
 	i = 0;
 	host = list;
 	while(host) {
@@ -865,8 +861,7 @@ finish(int sig)
 	}
 
 	/* finish with an empty line */
-        do_output_char('\n');
-
+        do_output(0,"\n");
         exit_code = status;
         longjmp(exit_jmp, 1);
 }



More information about the checkmk-commits mailing list