[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Richard Levitte levitte at openssl.org
Thu Feb 23 14:29:51 UTC 2017


The branch OpenSSL_1_0_2-stable has been updated
       via  56fbd5cff879a1d06e6b2023f43aebecc75fde2b (commit)
      from  6cc190f988c8d41407e562d426f90722706fd8b3 (commit)


- Log -----------------------------------------------------------------
commit 56fbd5cff879a1d06e6b2023f43aebecc75fde2b
Author: Andy Polyakov <appro at openssl.org>
Date:   Wed Apr 6 11:21:14 2016 +0200

    bio/bss_file.c: since VS2015 one can't tell apart own and "alien" FILE
    pointers, except for minimal std[in|out|err].
    
    (cherry picked from commit 800b299b0a53c871be57c4b2c97c95d6642489ea)
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2701)

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

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

diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c
index a6e3b3a..abdcf4e 100644
--- a/crypto/bio/bss_file.c
+++ b/crypto/bio/bss_file.c
@@ -251,7 +251,7 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
             ret = fread(out, 1, (int)outl, (FILE *)b->ptr);
         if (ret == 0
             && (b->flags & BIO_FLAGS_UPLINK) ? UP_ferror((FILE *)b->ptr) :
-            ferror((FILE *)b->ptr)) {
+                                               ferror((FILE *)b->ptr)) {
             SYSerr(SYS_F_FREAD, get_last_sys_error());
             BIOerr(BIO_F_FILE_READ, ERR_R_SYS_LIB);
             ret = -1;
@@ -318,8 +318,11 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
 #   if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES)
 #    define _IOB_ENTRIES 20
 #   endif
-#   if defined(_IOB_ENTRIES)
         /* Safety net to catch purely internal BIO_set_fp calls */
+#   if defined(_MSC_VER) && _MSC_VER>=1900
+        if (ptr == stdin || ptr == stdout || ptr == stderr)
+            BIO_clear_flags(b, BIO_FLAGS_UPLINK);
+#   elif defined(_IOB_ENTRIES)
         if ((size_t)ptr >= (size_t)stdin &&
             (size_t)ptr < (size_t)(stdin + _IOB_ENTRIES))
             BIO_clear_flags(b, BIO_FLAGS_UPLINK);


More information about the openssl-commits mailing list