summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2019-04-01 15:48:50 +0000
committerjsing <jsing@openbsd.org>2019-04-01 15:48:50 +0000
commit2dcf05e720ac9f22d6cce37b11405d3d14e76df8 (patch)
treef26d23c888e632f6f7fe4c287cde4e0759057aa7
parentRequire all ASN1_PRIMITIVE_FUNCS functions to be provided. (diff)
downloadwireguard-openbsd-2dcf05e720ac9f22d6cce37b11405d3d14e76df8.tar.xz
wireguard-openbsd-2dcf05e720ac9f22d6cce37b11405d3d14e76df8.zip
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@
-rw-r--r--lib/libcrypto/asn1/x_long.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libcrypto/asn1/x_long.c b/lib/libcrypto/asn1/x_long.c
index efafce15fe2..61685c31a37 100644
--- a/lib/libcrypto/asn1/x_long.c
+++ b/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;
}