Skip to content

Commit

Permalink
Add .. to runtime library name check
Browse files Browse the repository at this point in the history
  • Loading branch information
kthui committed Nov 28, 2023
1 parent f22a84c commit 1c2c618
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/model_config_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ AssembleCPPRuntimeLibraryName(const std::string& backend_name)
Status
IsRuntimeLibraryNameWellFormed(const std::string& library_name)
{
const static std::vector<std::string> excluded_strings = {"\\", "/"};
const static std::vector<std::string> excluded_strings = {"\\", "/", ".."};
for (const auto& excluded_str : excluded_strings) {
if (library_name.find(excluded_str) != library_name.npos) {
return Status(
Expand Down
2 changes: 1 addition & 1 deletion src/model_config_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1c2c618

Please sign in to comment.