From 8f622ff71bf95101d19ba9abf5f0ddf10ecb6511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophane=20Hufschmitt?= Date: Mon, 11 Apr 2022 10:20:36 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20fail=20when=20the=20store=20con?= =?UTF-8?q?tains=20some=20invalid=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libstore/gc.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index a07a67a8f..1499296fb 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -341,9 +341,12 @@ Roots LocalStore::findRoots(bool censor) throw Error("Invalid result from the gc helper"); auto rawDestPath = parsedLine[0]; if (!isInStore(rawDestPath)) continue; - auto destPath = toStorePath(rawDestPath).first; - if (!isValidPath(destPath)) continue; - roots[destPath].insert(parsedLine[1]); + try { + auto destPath = toStorePath(rawDestPath).first; + if (!isValidPath(destPath)) continue; + roots[destPath].insert(parsedLine[1]); + } catch (Error &) { + } } } catch (EndOfFile &) { }