diff options
author | 2019-04-01 15:48:50 +0000 | |
---|---|---|
committer | 2019-04-01 15:48:50 +0000 | |
commit | 2dcf05e720ac9f22d6cce37b11405d3d14e76df8 (patch) | |
tree | f26d23c888e632f6f7fe4c287cde4e0759057aa7 | |
parent | Require all ASN1_PRIMITIVE_FUNCS functions to be provided. (diff) | |
download | wireguard-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.c | 7 |
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; } |