|
| 1 | +From 4bc70904d4e31b768f38c2b321c29a370c614497 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Suneel Yadava < [email protected]> |
| 3 | +Date: Mon, 23 Jun 2025 10:51:55 +0000 |
| 4 | +Subject: [PATCH] Fix for CVE-2025-6140 |
| 5 | +Upstream Patch Reference: |
| 6 | +https://github.com/gabime/spdlog/commit/10320184df1eb4638e253a34b1eb44ce78954094 |
| 7 | + |
| 8 | +--- |
| 9 | + deps/spdlog/include/spdlog/pattern_formatter-inl.h | 5 ++++- |
| 10 | + 1 file changed, 4 insertions(+), 1 deletion(-) |
| 11 | + |
| 12 | +diff --git a/deps/spdlog/include/spdlog/pattern_formatter-inl.h b/deps/spdlog/include/spdlog/pattern_formatter-inl.h |
| 13 | +index 01afbe6..ee01489 100644 |
| 14 | +--- a/deps/spdlog/include/spdlog/pattern_formatter-inl.h |
| 15 | ++++ b/deps/spdlog/include/spdlog/pattern_formatter-inl.h |
| 16 | +@@ -76,6 +76,9 @@ public: |
| 17 | + else if (padinfo_.truncate_) |
| 18 | + { |
| 19 | + long new_size = static_cast<long>(dest_.size()) + remaining_pad_; |
| 20 | ++ if (new_size < 0) { |
| 21 | ++ new_size = 0; |
| 22 | ++ } |
| 23 | + dest_.resize(static_cast<size_t>(new_size)); |
| 24 | + } |
| 25 | + } |
| 26 | +@@ -303,7 +306,7 @@ public: |
| 27 | + |
| 28 | + void format(const details::log_msg &, const std::tm &tm_time, memory_buf_t &dest) override |
| 29 | + { |
| 30 | +- const size_t field_size = 10; |
| 31 | ++ const size_t field_size = 8; |
| 32 | + ScopedPadder p(field_size, padinfo_, dest); |
| 33 | + |
| 34 | + fmt_helper::pad2(tm_time.tm_mon + 1, dest); |
| 35 | +-- |
| 36 | +2.45.3 |
| 37 | + |
0 commit comments