From 89fceea2529b117a60f443fa9ad69a88103da8bc Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Wed, 13 Nov 2024 02:42:19 +0000 Subject: [PATCH] Specialize formatted_log for string without arguments (fix potential security error). --- include/rmm/detail/format.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/rmm/detail/format.hpp b/include/rmm/detail/format.hpp index a51008a38..509d066fe 100644 --- a/include/rmm/detail/format.hpp +++ b/include/rmm/detail/format.hpp @@ -56,6 +56,13 @@ std::string formatted_log(std::string const& format, Args&&... args) return {buf.get(), buf.get() + size - 1}; // drop '\0' } +// specialization for no arguments +template <> +inline std::string formatted_log(std::string const& format) +{ + return format; +} + // Stringify a size in bytes to a human-readable value inline std::string format_bytes(std::size_t value) {