Fix error handling in get_header_and_data.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 9 Jul 2017 19:24:18 +0000 (21:24 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 10 Jul 2017 14:25:43 +0000 (16:25 +0200)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/3896)

crypto/pem/pem_lib.c

index aacdad9e632e0c7c095401efeb61ec90159a0113..2a52aca3b703ec9864ec597ab53abb4f48d8aa11 100644 (file)
@@ -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.
          */