Skip to content

Commit

Permalink
NAR parser: Fix missing name field check
Browse files Browse the repository at this point in the history
Discovered by @Kloenk.
  • Loading branch information
edolstra committed Jun 29, 2020
1 parent 58bc3b6 commit 2b834d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libutil/archive.cc
Expand Up @@ -262,7 +262,7 @@ static void parse(ParseSink & sink, Source & source, const Path & path)
names[name] = 0;
}
} else if (s == "node") {
if (s.empty()) throw badArchive("entry name missing");
if (name.empty()) throw badArchive("entry name missing");
parse(sink, source, path + "/" + name);
} else
throw badArchive("unknown field " + s);
Expand Down

0 comments on commit 2b834d4

Please sign in to comment.