mirror of https://gitee.com/bigwinds/arangodb
fix path length checks when copying js files (#9191)
This commit is contained in:
parent
1d2071420b
commit
e0c94e64d7
|
@ -504,11 +504,12 @@ void V8DealerFeature::copyInstallationFiles() {
|
||||||
if (filename.size() >= nodeModulesPath.size()) {
|
if (filename.size() >= nodeModulesPath.size()) {
|
||||||
std::string normalized = filename;
|
std::string normalized = filename;
|
||||||
FileUtils::normalizePath(normalized);
|
FileUtils::normalizePath(normalized);
|
||||||
TRI_ASSERT(filename.size() == normalized.size());
|
if ((!nodeModulesPath.empty() &&
|
||||||
if (normalized.substr(normalized.size() - nodeModulesPath.size(),
|
normalized.size() >= nodeModulesPath.size() &&
|
||||||
nodeModulesPath.size()) == nodeModulesPath ||
|
normalized.substr(normalized.size() - nodeModulesPath.size(), nodeModulesPath.size()) == nodeModulesPath) ||
|
||||||
normalized.substr(normalized.size() - nodeModulesPathVersioned.size(),
|
(!nodeModulesPathVersioned.empty() &&
|
||||||
nodeModulesPathVersioned.size()) == nodeModulesPathVersioned) {
|
normalized.size() >= nodeModulesPathVersioned.size() &&
|
||||||
|
normalized.substr(normalized.size() - nodeModulesPathVersioned.size(), nodeModulesPathVersioned.size()) == nodeModulesPathVersioned)) {
|
||||||
// filter it out!
|
// filter it out!
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue