aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Gerhard Lausser <gerhard.lausser@consol.de> 2015-11-04 16:18:37 +0100
committerGravatar Gerhard Lausser <gerhard.lausser@consol.de> 2015-11-04 16:18:37 +0100
commit8727768834f6f7f27bcc0ffb465994124282f2bc (patch)
tree483ec614f83c4fb3d565d79b19b835d0afda924c
parentac380fd243e4eb7f0b1ace06dbdc276a3a13a9bb (diff)
downloadmonitoring-plugins-8727768834f6f7f27bcc0ffb465994124282f2bc.tar.gz
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.
-rw-r--r--plugins/check_http.c4
1 files changed, 4 insertions, 0 deletions
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);