Fix base64 decoding bug.

A short PEM encoded sequence if passed to the BIO, and the file
had 2 \n following would fail.

PR#3289
(cherry picked from commit 10378fb5f4c67270b800e8f7c600cd0548874811)
This commit is contained in:
Eric Young 2014-04-02 19:50:33 +01:00 committed by Dr. Stephen Henson
parent 4bc24cf01d
commit 9ad5c5e4f9

View File

@ -264,7 +264,7 @@ static int b64_read(BIO *b, char *out, int outl)
} }
/* we fell off the end without starting */ /* we fell off the end without starting */
if (j == i) if ((j == i) && (num == 0))
{ {
/* Is this is one long chunk?, if so, keep on /* Is this is one long chunk?, if so, keep on
* reading until a new line. */ * reading until a new line. */