summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomáš Mózes <hydrapolic@gmail.com>2023-02-08 11:32:07 +0000
committerSam James <sam@gentoo.org>2023-02-08 17:15:24 +0000
commit56788861591b9cd77eb629026613e038ea18d8c5 (patch)
tree672fab1dbdf981f4f955884a356c574c82ce8b22 /net-analyzer
parentapp-forensics/aide: remove unused patch (diff)
downloadgentoo-56788861591b9cd77eb629026613e038ea18d8c5.tar.gz
gentoo-56788861591b9cd77eb629026613e038ea18d8c5.tar.bz2
gentoo-56788861591b9cd77eb629026613e038ea18d8c5.zip
net-analyzer/monitoring-plugins: fix check_http segfault
Closes: https://bugs.gentoo.org/893252 Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/29481 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/monitoring-plugins/files/monitoring-plugins-fix-check-http-segfault.patch23
-rw-r--r--net-analyzer/monitoring-plugins/monitoring-plugins-2.3.3-r1.ebuild (renamed from net-analyzer/monitoring-plugins/monitoring-plugins-2.3.3.ebuild)3
2 files changed, 25 insertions, 1 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;
+ }
+
diff --git a/net-analyzer/monitoring-plugins/monitoring-plugins-2.3.3.ebuild b/net-analyzer/monitoring-plugins/monitoring-plugins-2.3.3-r1.ebuild
index bf2ccb76116a..555d75dae179 100644
--- a/net-analyzer/monitoring-plugins/monitoring-plugins-2.3.3.ebuild
+++ b/net-analyzer/monitoring-plugins/monitoring-plugins-2.3.3-r1.ebuild
@@ -58,7 +58,8 @@ RDEPEND="${DEPEND}
RESTRICT="test"
PATCHES=(
- "${FILESDIR}/monitoring-plugins-gnutls.patch"
+ "${FILESDIR}/${PN}-gnutls.patch" #880211
+ "${FILESDIR}/${PN}-fix-check-http-segfault.patch" #893252
)
src_configure() {