mirror of
https://github.com/NixOS/nix
synced 2025-06-28 09:31:16 +02:00
Make NAR header check more robust
Changes std::bad_alloc into bad archive: input doesn't look like a Nix archive
This commit is contained in:
parent
7ccdcc7fed
commit
44e86304b6
3 changed files with 5 additions and 4 deletions
|
@ -283,7 +283,7 @@ void parseDump(ParseSink & sink, Source & source)
|
|||
{
|
||||
string version;
|
||||
try {
|
||||
version = readString(source);
|
||||
version = readString(source, narVersionMagic1.size());
|
||||
} catch (SerialisationError & e) {
|
||||
/* This generally means the integer at the start couldn't be
|
||||
decoded. Ignore and throw the exception below. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue