summaryrefslogtreecommitdiff
path: root/CVE-2025-6140.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-10-16 03:59:25 +0000
committerCoprDistGit <infra@openeuler.org>2026-10-16 03:59:25 +0000
commit19dbcece56edd38c1d4c9f9fe188fb389fe06bed (patch)
tree52ae9bf123b0c440e72d1be245a5b93e3892d844 /CVE-2025-6140.patch
parent67764b53df5b6e072b5771e32cfd6032413b793b (diff)
automatic import of spdlogopeneuler25.09
Diffstat (limited to 'CVE-2025-6140.patch')
-rw-r--r--CVE-2025-6140.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/CVE-2025-6140.patch b/CVE-2025-6140.patch
new file mode 100644
index 0000000..110f6b1
--- /dev/null
+++ b/CVE-2025-6140.patch
@@ -0,0 +1,31 @@
+From 10320184df1eb4638e253a34b1eb44ce78954094 Mon Sep 17 00:00:00 2001
+From: Gabi Melman <gmelman1@gmail.com>
+Date: Mon, 17 Mar 2025 15:46:31 +0200
+Subject: [PATCH] Fixed issue #3360 (#3361)
+
+Backport of upstream commit 10320184df1eb4638e253a34b1eb44ce78954094 for
+spdlog 1.11.0 (CVE-2025-6140, allocation-size-too-big in scoped_padder).
+
+Only the scoped_padder fix is kept. The unrelated field_size change
+(D_formatter) and whitespace cleanup from the original upstream commit
+are intentionally dropped, since they are not part of this CVE's fix and
+would alter unrelated behavior.
+
+---
+ include/spdlog/pattern_formatter-inl.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/include/spdlog/pattern_formatter-inl.h b/include/spdlog/pattern_formatter-inl.h
+--- a/include/spdlog/pattern_formatter-inl.h
++++ b/include/spdlog/pattern_formatter-inl.h
+@@ -76,6 +76,10 @@
+ else if (padinfo_.truncate_)
+ {
+ long new_size = static_cast<long>(dest_.size()) + remaining_pad_;
++ if (new_size < 0)
++ {
++ new_size = 0;
++ }
+ dest_.resize(static_cast<size_t>(new_size));
+ }
+ }