diff options
Diffstat (limited to 'CVE-2025-6140.patch')
| -rw-r--r-- | CVE-2025-6140.patch | 31 |
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)); + } + } |
