From: claudio Date: Tue, 19 Apr 2022 13:25:08 +0000 (+0000) Subject: Make it a hard error when an unknown repoistory id is passed to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=441ac56a25cc6ee6b95560590e2bfd28de3d4ce5;p=openbsd 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@ --- 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;