From aa8dfbc421c1bcb5ba508802629c8005340f3a9e Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sun, 9 Jul 2017 21:24:18 +0200 Subject: [PATCH] Fix error handling in get_header_and_data. Reviewed-by: Tim Hudson Reviewed-by: Ben Kaduk (Merged from https://github.com/openssl/openssl/pull/3896) --- crypto/pem/pem_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index aacdad9e63..2a52aca3b7 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -859,7 +859,8 @@ static int get_header_and_data(BIO *bp, BIO **header, BIO **data, char *name, * Else, a line of text -- could be header or data; we don't * know yet. Just pass it through. */ - BIO_puts(tmp, linebuf); + if (BIO_puts(tmp, linebuf) < 0) + goto err; /* * Only encrypted files need the line length check applied. */ -- GitLab