From 4930381ec87c8bda10e1b79689cc89a22b336200 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Mon, 1 Apr 2019 15:48:50 +0000 Subject: Correct the return values from long_print. BIO_print() returns -1 on failure, whereas the ASN print functions need to return 0. ok beck@, tb@ --- src/lib/libcrypto/asn1/x_long.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/asn1/x_long.c b/src/lib/libcrypto/asn1/x_long.c index efafce15fe..61685c31a3 100644 --- a/src/lib/libcrypto/asn1/x_long.c +++ b/src/lib/libcrypto/asn1/x_long.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_long.c,v 1.13 2019/03/31 14:41:40 jsing Exp $ */ +/* $OpenBSD: x_long.c,v 1.14 2019/04/01 15:48:50 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -210,5 +210,8 @@ static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent, const ASN1_PCTX *pctx) { - return BIO_printf(out, "%ld\n", *(long *)pval); + if (BIO_printf(out, "%ld\n", *(long *)pval) <= 0) + return 0; + + return 1; } -- cgit v1.2.3-55-g6feb