From 2190ce157211f4175ec813e7cee5d80cca31e931 Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 23 May 2024 01:43:51 +0000 Subject: X509v3_get_ext_by_NID: make obj const, test & assign --- src/lib/libcrypto/x509/x509_v3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/x509/x509_v3.c b/src/lib/libcrypto/x509/x509_v3.c index 3666d24c07..2d122fd7a5 100644 --- a/src/lib/libcrypto/x509/x509_v3.c +++ b/src/lib/libcrypto/x509/x509_v3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_v3.c,v 1.24 2024/05/23 01:42:23 tb Exp $ */ +/* $OpenBSD: x509_v3.c,v 1.25 2024/05/23 01:43:51 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -80,11 +80,11 @@ LCRYPTO_ALIAS(X509v3_get_ext_count); int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid, int lastpos) { - ASN1_OBJECT *obj; + const ASN1_OBJECT *obj; - obj = OBJ_nid2obj(nid); - if (obj == NULL) + if ((obj = OBJ_nid2obj(nid)) == NULL) return -2; + return X509v3_get_ext_by_OBJ(x, obj, lastpos); } LCRYPTO_ALIAS(X509v3_get_ext_by_NID); -- cgit v1.2.3-55-g6feb