[monitoring-plugins] Update check_http.c
Gerhard Lausser <[email protected]> Fri, 11 Nov 2016 11:20:11 +0100 (CET)
| Newsgroups | gmane.network.nagios.cvs |
|---|---|
| Message-ID | <[email protected]> |
Module: monitoring-plugins Branch: master Commit: 8727768834f6f7f27bcc0ffb465994124282f2bc Author: Gerhard Lausser <[email protected]> Date: Wed Nov 4 16:18:37 2015 +0100 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=8727768 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(+) diff --git a/plugins/check_http.c b/plugins/check_http.c index 2038f4a..a2b7624 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);