From a6002f6a1c1b494ae995679bc33e98a63004bb61 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 25 Jul 2024 08:44:39 +0000 Subject: [PATCH] Silence a false positive warning for gcc The code path gcc is whining about ensures that the struct auth in question is initialized, but the pile of garbage that is gcc's use of uninitialized warnings can't figure that one out. Enough time on this was wasted during the last few releases that silencing gcc with annoying workarounds may be the lesser evil. ok claudio --- usr.sbin/rpki-client/filemode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rpki-client/filemode.c b/usr.sbin/rpki-client/filemode.c index 573063ffc5f..93eb7ef3ee2 100644 --- a/usr.sbin/rpki-client/filemode.c +++ b/usr.sbin/rpki-client/filemode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filemode.c,v 1.47 2024/06/17 18:54:36 tb Exp $ */ +/* $OpenBSD: filemode.c,v 1.48 2024/07/25 08:44:39 tb Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -313,7 +313,7 @@ print_signature_path(const char *crl, const char *aia, const struct auth *a) { if (crl != NULL) printf("Signature path: %s\n", crl); - if (a->cert->mft != NULL) + if (a != NULL && a->cert != NULL && a->cert->mft != NULL) printf(" %s\n", a->cert->mft); if (aia != NULL) printf(" %s\n", aia); @@ -352,7 +352,7 @@ proc_parser_file(char *file, unsigned char *buf, size_t len) char *aia = NULL; char *crl_uri = NULL; time_t *expires = NULL, *notafter = NULL; - struct auth *a; + struct auth *a = NULL; struct crl *c; const char *errstr = NULL, *valid; int status = 0; @@ -612,7 +612,7 @@ proc_parser_file(char *file, unsigned char *buf, size_t len) else { printf("\n"); - if (status && aia != NULL) { + if (aia != NULL && status) { print_signature_path(crl_uri, aia, a); if (expires != NULL) printf("Signature path expires: %s\n", -- 2.20.1