From 3b7f2bf99751bb51a9e9c4dab0fe2db1a6ff07ca Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 24 Mar 2024 00:54:44 +0100 Subject: [PATCH] git/dumpTree: Assert name not empty before back() --- src/libutil/git.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libutil/git.cc b/src/libutil/git.cc index 0b6e35222..a60589baa 100644 --- a/src/libutil/git.cc +++ b/src/libutil/git.cc @@ -251,6 +251,7 @@ void dumpTree(const Tree & entries, Sink & sink, for (auto & [name, entry] : entries) { auto name2 = name; if (entry.mode == Mode::Directory) { + assert(!name2.empty()); assert(name2.back() == '/'); name2.pop_back(); }