aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_http.c
diff options
context:
space:
mode:
authorGravatar Sven Nierlein <sven@nierlein.org> 2016-11-11 11:14:37 +0100
committerGravatar GitHub <noreply@github.com> 2016-11-11 11:14:37 +0100
commit2f845e9ebc2b7bcf6472e0191752215d351e4e7c (patch)
tree323cc0e81cb2f02785b0341bf1013836dfedf8c7 /plugins/check_http.c
parentf938327b495dab1f7543411aa3ecd8a384f8e2c3 (diff)
parent8727768834f6f7f27bcc0ffb465994124282f2bc (diff)
downloadmonitoring-plugins-2f845e9ebc2b7bcf6472e0191752215d351e4e7c.tar.gz
Merge pull request #1391 from lausser/patch-1
If a web page contains a nul character, check_http reads the complete page but --string does not search beyond this character.
Diffstat (limited to 'plugins/check_http.c')
-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 2ce7e215..60fe4d52 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1041,6 +1041,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);