1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Merge pull request #14496 from NixOS/backport-14491-to-2.30-maintenance

[Backport 2.30-maintenance] Don't crash on flakerefs containing newlines
This commit is contained in:
internal-nix-ci[bot] 2025-11-06 19:51:07 +00:00 committed by GitHub
commit 0cc9f0810f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,7 +80,8 @@ std::pair<FlakeRef, std::string> parsePathFlakeRefWithFragment(
std::smatch match;
auto succeeds = std::regex_match(url, match, pathFlakeRegex);
assert(succeeds);
if (!succeeds)
throw Error("invalid flakeref '%s'", url);
auto path = match[1].str();
auto query = decodeQuery(match[3]);
auto fragment = percentDecode(match[5].str());