[monitoring-plugins] check_curl: fixed a potential buffer overflow in ...

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


    Module: monitoring-plugins
    Branch: wip-2.3.1
    Commit: d5b81e8966d71ac2f13465fa308c9910b0e31992
    Author: Andreas Baumann <mail at andreasbaumann.cc>
 Committer: Jan Wagner <waja at cyconet.org>
      Date: Tue Jan 19 18:35:41 2021 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=d5b81e8

check_curl: fixed a potential buffer overflow in url buffer

---

 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 ef77918..a3f63f1 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -1041,7 +1041,7 @@ redir (curlhelp_write_curlbuf* header_buf)
     const UriPathSegmentA* p = uri.pathHead;
     for (; p; p = p->next) {
       strncat (new_url, "/", DEFAULT_BUFFER_SIZE);
-      strncat (new_url, uri_string (p->text, buf, DEFAULT_BUFFER_SIZE), DEFAULT_BUFFER_SIZE);
+      strncat (new_url, uri_string (p->text, buf, DEFAULT_BUFFER_SIZE), DEFAULT_BUFFER_SIZE-1);
     }
   }
 



More information about the Commits mailing list