From: job Date: Fri, 29 Dec 2023 14:35:43 +0000 (+0000) Subject: Fix a NULL access or use-after-free bug X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=949cd6063cec8198138ce07f55298da22de9cac3;p=openbsd Fix a NULL access or use-after-free bug This is a bandaid, the proc_parser_mft() is too complex and needs reworking OK tb@ --- diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index 575e2a9a4e8..47dc421bd5d 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.104 2023/12/18 23:42:20 job Exp $ */ +/* $OpenBSD: parser.c,v 1.105 2023/12/29 14:35:43 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -394,11 +394,10 @@ proc_parser_mft(struct entity *entp, struct mft **mp, char **crlfile, *mp = proc_parser_mft_post(file1, mft1, entp->path, err1, &warned); if (*mp == NULL) { - if (mft2 != NULL) - warnx("%s#%s: failed fetch, continuing with #%s" - " from cache", file1, mft1->seqnum, - mft2->seqnum); mft1 = NULL; + if (mft2 != NULL) + warnx("%s: failed fetch, continuing with #%s" + " from cache", file1, mft2->seqnum); } }