From daff3b5dc030ad00aa7c6f9068838f5f630bf13c Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 27 Nov 2025 08:22:32 +0000 Subject: openssl asn1pars: don't reach into ASN1_STRING ok kenjiro --- src/usr.bin/openssl/asn1pars.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/usr.bin/openssl/asn1pars.c b/src/usr.bin/openssl/asn1pars.c index 355784169e..52991c392e 100644 --- a/src/usr.bin/openssl/asn1pars.c +++ b/src/usr.bin/openssl/asn1pars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1pars.c,v 1.17 2025/01/02 12:31:44 tb Exp $ */ +/* $OpenBSD: asn1pars.c,v 1.18 2025/11/27 08:22:32 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -241,7 +241,7 @@ asn1parse_main(int argc, char **argv) BIO *in = NULL, *out = NULL, *b64 = NULL, *derout = NULL; char *str = NULL; const char *errstr = NULL; - unsigned char *tmpbuf; + const unsigned char *tmpbuf; const unsigned char *ctmpbuf; BUF_MEM *buf = NULL; ASN1_TYPE *at = NULL; @@ -368,8 +368,8 @@ asn1parse_main(int argc, char **argv) goto end; } /* hmm... this is a little evil but it works */ - tmpbuf = at->value.asn1_string->data; - tmplen = at->value.asn1_string->length; + tmpbuf = ASN1_STRING_get0_data(at->value.asn1_string); + tmplen = ASN1_STRING_length(at->value.asn1_string); } str = (char *) tmpbuf; num = tmplen; -- cgit v1.2.3-55-g6feb