From: tb Date: Mon, 5 Sep 2022 18:07:04 +0000 (+0000) Subject: Reset provider in each iteration X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=041f5afe1553df5d736c21dc7ff2291562307379;p=openbsd Reset provider in each iteration If a providerAS sets an afiLimit, subsequent providerAS that don't set it would erroneously inherit that limit. Zero out the provider at the top of the loop to avoid this problem. ok job --- diff --git a/usr.sbin/rpki-client/aspa.c b/usr.sbin/rpki-client/aspa.c index 8b3e509e9bf..f3ca518353b 100644 --- a/usr.sbin/rpki-client/aspa.c +++ b/usr.sbin/rpki-client/aspa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aspa.c,v 1.3 2022/09/05 12:25:32 tb Exp $ */ +/* $OpenBSD: aspa.c,v 1.4 2022/09/05 18:07:04 tb Exp $ */ /* * Copyright (c) 2022 Job Snijders * Copyright (c) 2022 Theo Buehler @@ -90,8 +90,6 @@ aspa_parse_providers(struct parse *p, const STACK_OF(ProviderAS) *providers) struct aspa_provider provider; size_t providersz, i; - memset(&provider, 0, sizeof(provider)); - if ((providersz = sk_ProviderAS_num(providers)) == 0) { warnx("%s: ASPA: ProviderASSet needs at least one entry", p->fn); @@ -111,6 +109,8 @@ aspa_parse_providers(struct parse *p, const STACK_OF(ProviderAS) *providers) for (i = 0; i < providersz; i++) { pa = sk_ProviderAS_value(providers, i); + memset(&provider, 0, sizeof(provider)); + if (!as_id_parse(pa->providerASID, &provider.as)) { warnx("%s: ASPA: malformed ProviderAS", p->fn); return 0;