From d9601db10d81584da0aa790d793befaeb1b8d2b0 Mon Sep 17 00:00:00 2001 From: Samuel Connelly <140354451+myclevorname@users.noreply.github.com> Date: Fri, 3 Oct 2025 18:41:01 -0400 Subject: [PATCH] libutil: Throw if `str("contents")` not found This was broken in 7aa3e7e3a5281acf350eff0fe039656cd4986e2c (since 2.25). (cherry picked from commit 242f3625675cc06069edfd0936ad6f42acb068a8) --- src/libutil/archive.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index b978ac4db..3d96df75e 100644 --- a/src/libutil/archive.cc +++ b/src/libutil/archive.cc @@ -187,8 +187,10 @@ static void parse(FileSystemObjectSink & sink, Source & source, const CanonPath tag = getString(); } - if (tag == "contents") - parseContents(crf, source); + if (tag != "contents") + throw badArchive("expected tag 'contents', got '%s'", tag); + + parseContents(crf, source); expectTag(")"); });