[monitoring-plugins] check_http: reject negative chunk sizes (#2380)

GitHub git at monitoring-plugins.org
Wed Oct 21 15:20:14 CEST 2026


    Module: monitoring-plugins
    Branch: master
    Commit: e7980cb0a5f3d75ace37d4e80050934247f26050
    Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
 Committer: GitHub <noreply at github.com>
      Date: Wed Oct 21 15:17:51 2026 +0200
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=e7980cb0

check_http: reject negative chunk sizes (#2380)

Co-authored-by: Lorenz Kästle <lorenz.kaestle+gitub-mopl at mailbox.org>

---

 plugins/check_http.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/plugins/check_http.c b/plugins/check_http.c
index 84b73812..dfc0db57 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1490,6 +1490,7 @@ char *unchunk_content(const char *content) {
 			}
 			return NULL;
 		}
+
 		if (endptr == pointer) {
 			// Apparently this was not a number
 			if (verbose) {
@@ -1498,6 +1499,13 @@ char *unchunk_content(const char *content) {
 			return NULL;
 		}
 
+		if (size_of_chunk < 0) {
+			if (verbose) {
+				printf("Chunked content size was a negative number (Line: %u)\n", __LINE__);
+			}
+			return NULL;
+		}
+
 		// So, we got the length of the chunk
 		if (*endptr == ';') {
 			// Chunk extension starts here



More information about the Commits mailing list