@@ -16,7 +16,7 @@ QStringList Settings::parparBin(bool* isSystemExecutable) const
1616 if (!pathNode.isEmpty ()) {
1717 if (pathNode != " node" ) // system executable - can't make absolute
1818 pathNode = pathConverter (pathNode);
19- return {pathConverter ( pathNode) , pathConverter (pathParPar)};
19+ return {pathNode, pathConverter (pathParPar)};
2020 } else {
2121 if (pathParPar != " parpar" )
2222 pathParPar = pathConverter (pathParPar);
@@ -70,17 +70,18 @@ static QString relPathConverter(const QString& file)
7070 QDir cd;
7171 QFileInfo info (file);
7272 if (info.isAbsolute ()) {
73- QString relPath = cd.relativeFilePath (file). replace ( " / " , QDir::separator ()) ;
73+ QString relPath = cd.relativeFilePath (file);
7474#ifdef Q_OS_WINDOWS
7575 // on Windows, can't use relative paths if on different drives (or drive <> UNC path)
7676 if (cd.absolutePath ().left (2 ).compare (file.left (2 ), Qt::CaseInsensitive) == 0 )
7777#else
7878 // on *nix, path in current dir should have preceeding './'
7979 // (we don't really require it, because we're not executing over a shell, but it distinguishes a local binary vs system binary)
80- if (!relPath.contains (QDir::separator () ))
80+ if (!relPath.contains (" / " ))
8181 return QString (" ." ) + QDir::separator () + relPath;
8282#endif
83- return relPath;
83+ if (!relPath.startsWith (" ../" )) // only allow relative paths if in the same folder
84+ return relPath.replace (" /" , QDir::separator ());
8485 }
8586 return file;
8687}
0 commit comments