summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl
diff options
context:
space:
mode:
authortb <>2025-11-27 08:22:32 +0000
committertb <>2025-11-27 08:22:32 +0000
commitdaff3b5dc030ad00aa7c6f9068838f5f630bf13c (patch)
treeef4f1609f84b9c65c47c110b90250b98fb71e0a2 /src/usr.bin/openssl
parent4879f73ba340a5a6a1e4b5812f046c92cf362d95 (diff)
downloadopenbsd-daff3b5dc030ad00aa7c6f9068838f5f630bf13c.tar.gz
openbsd-daff3b5dc030ad00aa7c6f9068838f5f630bf13c.tar.bz2
openbsd-daff3b5dc030ad00aa7c6f9068838f5f630bf13c.zip
openssl asn1pars: don't reach into ASN1_STRING
ok kenjiro
Diffstat (limited to '')
-rw-r--r--src/usr.bin/openssl/asn1pars.c8
1 files changed, 4 insertions, 4 deletions
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 @@
1/* $OpenBSD: asn1pars.c,v 1.17 2025/01/02 12:31:44 tb Exp $ */ 1/* $OpenBSD: asn1pars.c,v 1.18 2025/11/27 08:22:32 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -241,7 +241,7 @@ asn1parse_main(int argc, char **argv)
241 BIO *in = NULL, *out = NULL, *b64 = NULL, *derout = NULL; 241 BIO *in = NULL, *out = NULL, *b64 = NULL, *derout = NULL;
242 char *str = NULL; 242 char *str = NULL;
243 const char *errstr = NULL; 243 const char *errstr = NULL;
244 unsigned char *tmpbuf; 244 const unsigned char *tmpbuf;
245 const unsigned char *ctmpbuf; 245 const unsigned char *ctmpbuf;
246 BUF_MEM *buf = NULL; 246 BUF_MEM *buf = NULL;
247 ASN1_TYPE *at = NULL; 247 ASN1_TYPE *at = NULL;
@@ -368,8 +368,8 @@ asn1parse_main(int argc, char **argv)
368 goto end; 368 goto end;
369 } 369 }
370 /* hmm... this is a little evil but it works */ 370 /* hmm... this is a little evil but it works */
371 tmpbuf = at->value.asn1_string->data; 371 tmpbuf = ASN1_STRING_get0_data(at->value.asn1_string);
372 tmplen = at->value.asn1_string->length; 372 tmplen = ASN1_STRING_length(at->value.asn1_string);
373 } 373 }
374 str = (char *) tmpbuf; 374 str = (char *) tmpbuf;
375 num = tmplen; 375 num = tmplen;