]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Remove _strlen31
authorNeil Horman <nhorman@openssl.org>
Wed, 4 Jun 2025 19:48:45 +0000 (15:48 -0400)
committerTomas Mraz <tomas@openssl.org>
Fri, 6 Jun 2025 08:08:32 +0000 (10:08 +0200)
This function is old and fairly broken.  Code archeology in our git tree
hasn't revealed why it was creted (though it may have possibly been to
support older win32 systems that couldn't do 64 bit integers properly,
like windows 95/98).

There seems to be no good reason to keep it around, and given that it
has potentially serious side effects, lets just remove it.

Fixes #27761

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27763)

(cherry picked from commit b0d363a2cb039eac2908b7cb00b395235373193e)
(cherry picked from commit a4acf026ec92de423829d26f9988ef7f0d886c6f)

include/internal/e_os.h

index 003d63e17f2a8cc5efa5b561340ba63d7cb0a066..024f85477bc10d95c089539c48a4b590a98f8fc4 100644 (file)
 #    define EACCES   13
 #   endif
 #   include <string.h>
-#   ifdef _WIN64
-#    define strlen(s) _strlen31(s)
-/* cut strings to 2GB */
-static __inline unsigned int _strlen31(const char *str)
-{
-    unsigned int len = 0;
-    while (*str && len < 0x80000000U)
-        str++, len++;
-    return len & 0x7FFFFFFF;
-}
-#   endif
 #   include <malloc.h>
 #   if defined(_MSC_VER) && !defined(_WIN32_WCE) && !defined(_DLL) && defined(stdin)
 #    if _MSC_VER>=1300 && _MSC_VER<1600