summaryrefslogtreecommitdiff
path: root/net-analyzer/monitoring-plugins/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-02-12 09:56:54 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-02-12 09:56:54 +0000
commitebc282ef4dfa408accac685565b8ee5f6faec119 (patch)
treec0a4f713228cda0ab17eed46f0bb7ca8cb8be2f6 /net-analyzer/monitoring-plugins/files
parent6c8694a707151d59555b0e4e48235f085ce166c3 (diff)
gentoo auto-resync : 12:02:2023 - 09:56:54
Diffstat (limited to 'net-analyzer/monitoring-plugins/files')
-rw-r--r--net-analyzer/monitoring-plugins/files/monitoring-plugins-fix-check-http-segfault.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/net-analyzer/monitoring-plugins/files/monitoring-plugins-fix-check-http-segfault.patch b/net-analyzer/monitoring-plugins/files/monitoring-plugins-fix-check-http-segfault.patch
new file mode 100644
index 000000000000..34e539f51e2d
--- /dev/null
+++ b/net-analyzer/monitoring-plugins/files/monitoring-plugins-fix-check-http-segfault.patch
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/893252
+https://github.com/monitoring-plugins/monitoring-plugins/issues/1836
+https://github.com/monitoring-plugins/monitoring-plugins/commit/6d3e44d2d8395076060e9c741e9b173dc5d57b76
+
+diff --git a/plugins/check_http.c b/plugins/check_http.c
+index 5fa310f5d..8dda046ff 100644
+--- a/plugins/check_http.c
++++ b/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) {
++ // 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';
++ }
+ return result;
+ }
+