Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check for maximum size of downloaded file names #1842

Merged
merged 2 commits into from
Jan 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/AppInstallerCLICore/Workflows/DownloadFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ namespace AppInstaller::CLI::Workflow
// Get file name from download URI
std::filesystem::path filename = GetFileNameFromURI(context.Get<Execution::Data::Installer>()->Url);

// Assuming that we find a stem value in the URI, use it.
// Assuming that we find a safe stem value in the URI, use it.
// This should be extremely common, but just in case fall back to the older name style.
if (filename.has_stem())
if (filename.has_stem() && filename.string().size() < MAX_PATH)
jedieaston marked this conversation as resolved.
Show resolved Hide resolved
{
filename = filename.stem();
}
Expand Down