summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Young <eay@pobox.com>2014-04-02 19:50:33 +0100
committerDr. Stephen Henson <steve@openssl.org>2014-04-02 19:57:27 +0100
commitbfc3424d1fbaf684c812c03e3c6cb8d38d2d6f1d (patch)
tree7795feba3d3b05f605b0b0eea99d8dd9e40d090c
parent1c65936882a57eb24e6410e4bb705d9b9131d093 (diff)
downloadopenssl-new-bfc3424d1fbaf684c812c03e3c6cb8d38d2d6f1d.tar.gz
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)
-rw-r--r--crypto/evp/bio_b64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/bio_b64.c b/crypto/evp/bio_b64.c
index 72a2a67277..ac6d441aad 100644
--- a/crypto/evp/bio_b64.c
+++ b/crypto/evp/bio_b64.c
@@ -264,7 +264,7 @@ static int b64_read(BIO *b, char *out, int outl)
}
/* 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
* reading until a new line. */