Skip to content

Commit

Permalink
found-cwe-416
Browse files Browse the repository at this point in the history
  • Loading branch information
Jellybin06 committed Jan 2, 2024
1 parent d054f0d commit 1d20240
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ class LinuxModule : public Module
if (!filesystem::is_directory (modulePath))
return {};

stem.replace_extension (".so");
modulePath /= stem;
auto newStem = stem;
newStem.replace_extension(".so");
modulePath /= newStem;

return Optional<Path> (std::move (modulePath));
}

Expand Down Expand Up @@ -323,11 +325,14 @@ Module::SnapshotList Module::getSnapshots (const std::string& modulePath)
{
filesystem::path p (png);
auto filename = p.filename ().generic_string ();
auto uid = Snapshot::decodeUID (filename);
std::string decodedFilename = filename;
auto uid = Snapshot::decodeUID(decodedFilename);

if (!uid)
continue;
auto scaleFactor = 1.;
if (auto decodedScaleFactor = Snapshot::decodeScaleFactor (filename))
std::string decodedFilename = filename;
if (auto decodedScaleFactor = Snapshot::decodeScaleFactor(decodedFilename))
scaleFactor = *decodedScaleFactor;

Module::Snapshot::ImageDesc desc;
Expand Down Expand Up @@ -366,4 +371,4 @@ Optional<std::string> Module::getModuleInfoPath (const std::string& modulePath)

//------------------------------------------------------------------------
} // Hosting
} // VST3
} // VST3

0 comments on commit 1d20240

Please sign in to comment.