[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Richard Levitte levitte at openssl.org
Tue Feb 13 18:24:31 UTC 2018


The branch OpenSSL_1_1_0-stable has been updated
       via  a2019575614c0e9f81223348da360d058ff30883 (commit)
      from  3493b39d17bc064dcf0e81bceeeb3dff18cb1944 (commit)


- Log -----------------------------------------------------------------
commit a2019575614c0e9f81223348da360d058ff30883
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Feb 13 19:18:46 2018 +0100

    Fix bug in BIO_f_linebuffer()
    
    In BIO_f_linebuffer, this would cause an error:
    
        BIO_write(bio, "1\n", 1);
    
    I.e. there's a \n just after the part of the string that we currently
    ask to get written.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5353)

-----------------------------------------------------------------------

Summary of changes:
 crypto/bio/bf_lbuf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/crypto/bio/bf_lbuf.c b/crypto/bio/bf_lbuf.c
index 3f2ac2c..58dd7ac 100644
--- a/crypto/bio/bf_lbuf.c
+++ b/crypto/bio/bf_lbuf.c
@@ -116,9 +116,10 @@ static int linebuffer_write(BIO *b, const char *in, int inl)
 
     do {
         const char *p;
+        char c;
 
-        for (p = in; p < in + inl && *p != '\n'; p++) ;
-        if (*p == '\n') {
+        for (p = in, c = '\0'; p < in + inl && (c = *p) != '\n'; p++) ;
+        if (c == '\n') {
             p++;
             foundnl = 1;
         } else


More information about the openssl-commits mailing list