summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2018-08-24 19:48:39 +0000
committertb <>2018-08-24 19:48:39 +0000
commitd0c3bed9b20fc2f7d58864d7d0a73af6514f42b6 (patch)
treed377623a8ae6b6b8842b804f76fd78c913eeac3f
parent78839b084d2c63cfe49dbc9373306c75c033f866 (diff)
downloadopenbsd-d0c3bed9b20fc2f7d58864d7d0a73af6514f42b6.tar.gz
openbsd-d0c3bed9b20fc2f7d58864d7d0a73af6514f42b6.tar.bz2
openbsd-d0c3bed9b20fc2f7d58864d7d0a73af6514f42b6.zip
Check return value of EVP_EncodeUpdate() in PEM_write_bio().
ok jsing
-rw-r--r--src/lib/libcrypto/pem/pem_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c
index bffd1fa954..6661a222f0 100644
--- a/src/lib/libcrypto/pem/pem_lib.c
+++ b/src/lib/libcrypto/pem/pem_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_lib.c,v 1.47 2018/05/13 10:47:54 tb Exp $ */ 1/* $OpenBSD: pem_lib.c,v 1.48 2018/08/24 19:48:39 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 *
@@ -613,7 +613,8 @@ PEM_write_bio(BIO *bp, const char *name, const char *header,
613 i = j = 0; 613 i = j = 0;
614 while (len > 0) { 614 while (len > 0) {
615 n = (int)((len > (PEM_BUFSIZE * 5)) ? (PEM_BUFSIZE * 5) : len); 615 n = (int)((len > (PEM_BUFSIZE * 5)) ? (PEM_BUFSIZE * 5) : len);
616 EVP_EncodeUpdate(&ctx, buf, &outl, &(data[j]), n); 616 if (!EVP_EncodeUpdate(&ctx, buf, &outl, &(data[j]), n))
617 goto err;
617 if ((outl) && (BIO_write(bp, (char *)buf, outl) != outl)) 618 if ((outl) && (BIO_write(bp, (char *)buf, outl) != outl))
618 goto err; 619 goto err;
619 i += outl; 620 i += outl;