From: tb Date: Mon, 17 Jun 2024 18:54:36 +0000 (+0000) Subject: Invalidate the right stack[] member X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=68dbd0336060e08b09397bfd60f3d8a4e86b9f09;p=openbsd Invalidate the right stack[] member There was a shift of the index in the for loop, and invalidating the wrong member could result in a double free in auth_tree_free() on process exit. ok claudio job --- diff --git a/usr.sbin/rpki-client/filemode.c b/usr.sbin/rpki-client/filemode.c index 70c6cf11259..573063ffc5f 100644 --- a/usr.sbin/rpki-client/filemode.c +++ b/usr.sbin/rpki-client/filemode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filemode.c,v 1.46 2024/06/12 10:03:09 tb Exp $ */ +/* $OpenBSD: filemode.c,v 1.47 2024/06/17 18:54:36 tb Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -227,7 +227,7 @@ parse_load_certchain(char *uri) cert->talid = a->cert->talid; a = auth_insert(uri, &auths, cert, a); uripath_add(uri, cert); - stack[i] = NULL; + stack[i - 1] = NULL; } return a;