summaryrefslogtreecommitdiffstats
path: root/plugins/check_http.c
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.org>2016-11-11 10:14:37 (GMT)
committerGitHub <noreply@github.com>2016-11-11 10:14:37 (GMT)
commit2f845e9ebc2b7bcf6472e0191752215d351e4e7c (patch)
tree323cc0e81cb2f02785b0341bf1013836dfedf8c7 /plugins/check_http.c
parentf938327b495dab1f7543411aa3ecd8a384f8e2c3 (diff)
parent8727768834f6f7f27bcc0ffb465994124282f2bc (diff)
downloadmonitoring-plugins-2f845e9ebc2b7bcf6472e0191752215d351e4e7c.tar.gz
Merge pull request #1391 from lausser/patch-1refs/pull/1444/head
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 2ce7e21..60fe4d5 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1041,6 +1041,10 @@ check_http (void)
1041 microsec_firstbyte = deltime (tv_temp); 1041 microsec_firstbyte = deltime (tv_temp);
1042 elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6; 1042 elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6;
1043 } 1043 }
1044 while (pos = memchr(buffer, '\0', i)) {
1045 /* replace nul character with a blank */
1046 *pos = ' ';
1047 }
1044 buffer[i] = '\0'; 1048 buffer[i] = '\0';
1045 xasprintf (&full_page_new, "%s%s", full_page, buffer); 1049 xasprintf (&full_page_new, "%s%s", full_page, buffer);
1046 free (full_page); 1050 free (full_page);