]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Revert "Work around Windows ftell() bug as per Microsoft engineering's suggestion"
authorJosh Cooper <joshcooper@users.noreply.github.com>
Wed, 16 Oct 2024 19:24:03 +0000 (12:24 -0700)
committerTomas Mraz <tomas@openssl.org>
Tue, 28 Jan 2025 19:57:14 +0000 (20:57 +0100)
This reverts commit 8300a8742b2abc487594a09b5e6ee726dbd30771.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25716)

crypto/bio/bss_file.c

index 05d87cfe90faee8a9a191ad97d9fc86d7a5036ea..9082fce15953889576001701255b2f1d280c5e29 100644 (file)
@@ -235,15 +235,6 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
                 _setmode(fd, _O_TEXT);
             else
                 _setmode(fd, _O_BINARY);
-            /*
-             * Reports show that ftell() isn't trustable in text mode.
-             * This has been confirmed as a bug in the Universal C RTL, see
-             * https://developercommunity.visualstudio.com/content/problem/425878/fseek-ftell-fail-in-text-mode-for-unix-style-text.html
-             * The suggested work-around from Microsoft engineering is to
-             * turn off buffering until the bug is resolved.
-             */
-            if ((num & BIO_FP_TEXT) != 0)
-                setvbuf((FILE *)ptr, NULL, _IONBF, 0);
 # elif defined(OPENSSL_SYS_MSDOS)
             int fd = fileno((FILE *)ptr);
             /* Set correct text/binary mode */