[monitoring-plugins] check_curl: Fix bug where headers beginning with ...

Jan Wagner git at monitoring-plugins.org
Tue Apr 13 12:10:11 CEST 2021


    Module: monitoring-plugins
    Branch: master
    Commit: f0ac7fcc7c40fab04c00fbbc8c091e89e77b0f74
    Author: Barak Shohat <barak at bazzisoft.com>
 Committer: Jan Wagner <waja at cyconet.org>
      Date: Mon Apr 12 19:06:27 2021 +0300
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=f0ac7fc

check_curl: Fix bug where headers beginning with HTTP_ cause the status line parsing to fail.

---

 plugins/check_curl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 99833f6..3e0a6f9 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -1995,7 +1995,7 @@ curlhelp_parse_statusline (const char *buf, curlhelp_statusline *status_line)
   char *first_line_buf;
 
   /* find last start of a new header */
-  start = strrstr2 (buf, "\r\nHTTP");
+  start = strrstr2 (buf, "\r\nHTTP/");
   if (start != NULL) {
     start += 2;
     buf = start;



More information about the Commits mailing list