From df8d710f4f375a3e13772b400ce902930e2f09b8 Mon Sep 17 00:00:00 2001 From: AYMENJD <53928879+AYMENJD@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:47:23 +0300 Subject: [PATCH] Check that log tag is non-empty. --- td/telegram/Logging.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/td/telegram/Logging.cpp b/td/telegram/Logging.cpp index fc7d2a7a6568..65eb84174f37 100644 --- a/td/telegram/Logging.cpp +++ b/td/telegram/Logging.cpp @@ -127,6 +127,10 @@ vector Logging::get_tags() { } Status Logging::set_tag_verbosity_level(Slice tag, int new_verbosity_level) { + if (tag.empty()) { + return Status::Error("Log tag must be non-empty") + } + auto it = log_tags.find(tag); if (it == log_tags.end()) { return Status::Error("Log tag is not found"); @@ -138,6 +142,10 @@ Status Logging::set_tag_verbosity_level(Slice tag, int new_verbosity_level) { } Result Logging::get_tag_verbosity_level(Slice tag) { + if (tag.empty()) { + return Status::Error("Log tag must be non-empty") + } + auto it = log_tags.find(tag); if (it == log_tags.end()) { return Status::Error("Log tag is not found");