From 06a01064739a22a701fff0ffa54f1c35dd4b1cd7 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 29 May 2024 16:49:36 +0000 Subject: [PATCH] Make it possible for the large OID test to fail failed was set to 0 at the top of the function, so failure and success were indistinguishable. Move failed = 0 to the end so it can actually fail. --- regress/lib/libcrypto/asn1/asn1object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/regress/lib/libcrypto/asn1/asn1object.c b/regress/lib/libcrypto/asn1/asn1object.c index 0660f8af7db..e2008777d91 100644 --- a/regress/lib/libcrypto/asn1/asn1object.c +++ b/regress/lib/libcrypto/asn1/asn1object.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1object.c,v 1.12 2024/05/29 16:47:26 tb Exp $ */ +/* $OpenBSD: asn1object.c,v 1.13 2024/05/29 16:49:36 tb Exp $ */ /* * Copyright (c) 2017, 2021, 2022 Joel Sing * @@ -477,8 +477,6 @@ asn1_object_large_oid_test(void) int ret; int failed = 1; - failed = 0; - p = asn1_large_oid_der; aobj = d2i_ASN1_OBJECT(NULL, &p, sizeof(asn1_large_oid_der)); if (aobj == NULL) { @@ -499,6 +497,8 @@ asn1_object_large_oid_test(void) sizeof(asn1_large_oid_der))) goto failed; + failed = 0; + failed: ASN1_OBJECT_free(aobj); free(der); -- 2.20.1