From 1c2c618df891abbb480eff814e7e57369a589c10 Mon Sep 17 00:00:00 2001 From: kthui <18255193+kthui@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:36:18 -0800 Subject: [PATCH] Add .. to runtime library name check --- src/model_config_utils.cc | 2 +- src/model_config_utils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model_config_utils.cc b/src/model_config_utils.cc index b14c3e845..86323e7e4 100644 --- a/src/model_config_utils.cc +++ b/src/model_config_utils.cc @@ -2496,7 +2496,7 @@ AssembleCPPRuntimeLibraryName(const std::string& backend_name) Status IsRuntimeLibraryNameWellFormed(const std::string& library_name) { - const static std::vector excluded_strings = {"\\", "/"}; + const static std::vector excluded_strings = {"\\", "/", ".."}; for (const auto& excluded_str : excluded_strings) { if (library_name.find(excluded_str) != library_name.npos) { return Status( diff --git a/src/model_config_utils.h b/src/model_config_utils.h index 7412a0663..a6e273b3e 100644 --- a/src/model_config_utils.h +++ b/src/model_config_utils.h @@ -338,7 +338,7 @@ std::string AssembleCPPRuntimeLibraryName(const std::string& backend_name); /// Check if runtime library name is well formed. /// \param library_name The library name to check. -/// \return Success status if '\' and '/' characters are not in library name. +/// \return Success status if '\', '/' and '..' are not in library name. /// Error status if otherwise. Status IsRuntimeLibraryNameWellFormed(const std::string& library_name);