Skip to content

Commit

Permalink
bug RAISE_PLUGIN_ERROR returns a int so incompatible with std::string…
Browse files Browse the repository at this point in the history
… function, moved check to outside function
  • Loading branch information
jmeasure committed Jun 20, 2024
1 parent d9ca3b9 commit fbe5650
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/plugins/bytes/bytesPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ std::string resolve_filepath(char* path) {
}
}
if (counter > (int)foldernames.size()/2) {
RAISE_PLUGIN_ERROR("Illegal Path provided\n");
return "";
}
int i = -1;
while ( i < (int)foldernames.size()) {
Expand All @@ -212,6 +212,9 @@ int check_allowed_path(char* expandedPath) {
allowed_paths = split_string(env_str, ",");
}
std::string resolved_path = resolve_filepath(expandedPath);
if (resolved_path.compare("") == 0) {
RAISE_PLUGIN_ERROR("Illegal File Path Provided\n");
}
bool good_path = false;
for (std::string allowed_path : allowed_paths) {
if (resolved_path.rfind(allowed_path.c_str(), 0) != std::string::npos) {
Expand Down

0 comments on commit fbe5650

Please sign in to comment.