aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c')
-rw-r--r--net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c b/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c
index ce072578398b..a96b08af9a54 100644
--- a/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c
+++ b/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c
@@ -1,17 +1,17 @@
-diff --git a/plugins/check_http.c b/plugins/check_http.c
---- plugins/check_http.c.old
-+++ plugins/check_http.c
-@@ -1462,7 +1462,13 @@ char *unchunk_content(const char *content) {
- memcpy(result + (overall_size - size_of_chunk), start_of_chunk, size_of_chunk);
- }
-
-- result[overall_size] = '\0';
-+ if (overall_size == 0 && result == NULL) {
+--- plugins/check_http.c.orig 2025-11-08 16:43:35.500239000 +0100
++++ plugins/check_http.c 2025-11-08 17:09:19.591784000 +0100
+@@ -1476,7 +1476,13 @@ char *unchunk_content(const char *content) {
+ result = calloc(1, sizeof(char));
+ // No error handling here, we can only return NULL anyway
+ } else {
+- result[overall_size] = '\0';
++ if (overall_size == 0 && result == NULL) {
+ // We might just have received the end chunk without previous content, so result is never allocated
+ result = calloc(1, sizeof(char));
+ // No error handling here, we can only return NULL anyway
+ } else {
-+ result[overall_size] = '\0';
-+ }
++ result[overall_size] = '\0';
++ }
+ }
return result;
}