From 8467eaf0c756aae6919dc6f5f48651056c10f1bc Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2026 05:21:12 +0000 Subject: [PATCH 1/2] fix(OSQUERY-004): 2 review findings across 2 files --- osquery/tables/yara/yara_utils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osquery/tables/yara/yara_utils.cpp b/osquery/tables/yara/yara_utils.cpp index 3c935556c6c..56b74dd57e3 100644 --- a/osquery/tables/yara/yara_utils.cpp +++ b/osquery/tables/yara/yara_utils.cpp @@ -100,7 +100,7 @@ void YARACompilerCallback(int error_level, else ss << "YARA rule file " << file_name; if (error_level == YARA_ERROR_LEVEL_ERROR) { - VLOG(1) << ss.str() << "(" << line_number << "): error: " << message; + LOG(ERROR) << ss.str() << "(" << line_number << "): error: " << message; } else { VLOG(1) << ss.str() << "(" << line_number << "): warning: " << message; } @@ -472,3 +472,4 @@ Status YARAConfigParserPlugin::update(const std::string& source, /// Call the simple YARA ConfigParserPlugin "yara". REGISTER(YARAConfigParserPlugin, "config_parser", "yara"); } // namespace osquery + From 85633e60a77dfa00e1f0568264a520c04dec4a51 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2026 05:21:13 +0000 Subject: [PATCH 2/2] fix(OSQUERY-004): 2 review findings across 2 files --- osquery/utils/conversions/windows/strings.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/osquery/utils/conversions/windows/strings.cpp b/osquery/utils/conversions/windows/strings.cpp index 9d8f6283fa1..38f886f4eee 100644 --- a/osquery/utils/conversions/windows/strings.cpp +++ b/osquery/utils/conversions/windows/strings.cpp @@ -29,6 +29,12 @@ struct utf_converter { result.resize(str.length() * 2); auto count = MultiByteToWideChar( CP_UTF8, 0, str.c_str(), -1, &result[0], str.length() * 2); + if (count <= 0) { + LOG(WARNING) << "Failed to convert string to wstring, " + "MultiByteToWideChar error " + << GetLastError(); + return std::wstring(); + } result.resize(count - 1); } @@ -47,6 +53,12 @@ struct utf_converter { str.length() * 4, NULL, NULL); + if (count <= 0) { + LOG(WARNING) << "Failed to convert wstring to string, " + "WideCharToMultiByte error " + << GetLastError(); + return std::string(); + } result.resize(count - 1); } @@ -169,3 +181,4 @@ std::string errorDwordToString(DWORD error_code) { } } // namespace osquery +