From 8727768834f6f7f27bcc0ffb465994124282f2bc Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 4 Nov 2015 16:18:37 +0100 Subject: Update check_http.c If a web page contains a nul character, check_http reads the complete page but --expect does not search beyond this character. --- plugins/check_http.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins/check_http.c') diff --git a/plugins/check_http.c b/plugins/check_http.c index 2038f4a1..a2b76240 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -1022,6 +1022,10 @@ check_http (void) microsec_firstbyte = deltime (tv_temp); elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6; } + while (pos = memchr(buffer, '\0', i)) { + /* replace nul character with a blank */ + *pos = ' '; + } buffer[i] = '\0'; xasprintf (&full_page_new, "%s%s", full_page, buffer); free (full_page); -- cgit v1.2.3