Add check for BIO_indent return value
authorinoguchi <inoguchi@openbsd.org>
Thu, 20 Jan 2022 10:49:56 +0000 (10:49 +0000)
committerinoguchi <inoguchi@openbsd.org>
Thu, 20 Jan 2022 10:49:56 +0000 (10:49 +0000)
CID 24869

ok jsing@ millert@ tb@

lib/libcrypto/asn1/asn1_par.c

index e9fe520..2d1c7b2 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1_par.c,v 1.32 2022/01/14 23:55:46 inoguchi Exp $ */
+/* $OpenBSD: asn1_par.c,v 1.33 2022/01/20 10:49:56 inoguchi Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -80,7 +80,8 @@ asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
                p="prim: ";
        if (BIO_write(bp, p, 6) < 6)
                goto err;
-       BIO_indent(bp, indent, 128);
+       if (!BIO_indent(bp, indent, 128))
+               goto err;
 
        p = str;
        if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)