From 441ac56a25cc6ee6b95560590e2bfd28de3d4ce5 Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 19 Apr 2022 13:25:08 +0000 Subject: [PATCH] Make it a hard error when an unknown repoistory id is passed to parse_filepath(). If that happens something went very wrong and it is better to fail hard then to limp along. OK tb@ --- usr.sbin/rpki-client/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index 07b5bbd885d..abaa54c12cd 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.68 2022/04/19 09:52:29 claudio Exp $ */ +/* $OpenBSD: parser.c,v 1.69 2022/04/19 13:25:08 claudio Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -108,7 +108,7 @@ parse_filepath(unsigned int repoid, const char *path, const char *file, /* build file path based on repoid, entity path and filename */ rp = repo_get(repoid); if (rp == NULL) - return NULL; + errx(1, "build file path: repository %u missing", repoid); if (loc == DIR_VALID) repopath = rp->validpath; -- 2.20.1