From: job Date: Thu, 9 Mar 2023 15:40:41 +0000 (+0000) Subject: Fix segfault in filemode for RSC objects X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ad11fe974b2f0482f3ff269ec174d42544c2016c;p=openbsd Fix segfault in filemode for RSC objects --- diff --git a/usr.sbin/rpki-client/rsc.c b/usr.sbin/rpki-client/rsc.c index 12c091f7f18..0250d2e429d 100644 --- a/usr.sbin/rpki-client/rsc.c +++ b/usr.sbin/rpki-client/rsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsc.c,v 1.20 2023/03/09 09:46:21 job Exp $ */ +/* $OpenBSD: rsc.c,v 1.21 2023/03/09 15:40:41 job Exp $ */ /* * Copyright (c) 2022 Theo Buehler * Copyright (c) 2022 Job Snijders @@ -379,18 +379,20 @@ rsc_parse(X509 **x509, const char *fn, const unsigned char *der, size_t len) size_t cmsz; const ASN1_TIME *at; struct cert *cert = NULL; + time_t signtime; int rc = 0; memset(&p, 0, sizeof(struct parse)); p.fn = fn; cms = cms_parse_validate(x509, fn, der, len, rsc_oid, &cmsz, - &p.res->signtime); + &signtime); if (cms == NULL) return NULL; if ((p.res = calloc(1, sizeof(struct rsc))) == NULL) err(1, NULL); + p.res->signtime = signtime; if (!x509_get_aia(*x509, fn, &p.res->aia)) goto out;