From: Neil Horman Date: Wed, 4 Jun 2025 19:48:45 +0000 (-0400) Subject: Remove _strlen31 X-Git-Tag: openssl-3.3.4~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b944f11f4aefa7f0deb1d7b4c34bc2ac128c2404;p=thirdparty%2Fopenssl.git Remove _strlen31 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 Reviewed-by: Richard Levitte Reviewed-by: Tom Cosgrove Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27763) (cherry picked from commit b0d363a2cb039eac2908b7cb00b395235373193e) (cherry picked from commit a4acf026ec92de423829d26f9988ef7f0d886c6f) --- diff --git a/include/internal/e_os.h b/include/internal/e_os.h index 003d63e17f2..024f85477bc 100644 --- a/include/internal/e_os.h +++ b/include/internal/e_os.h @@ -126,17 +126,6 @@ # define EACCES 13 # endif # include -# 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 # if defined(_MSC_VER) && !defined(_WIN32_WCE) && !defined(_DLL) && defined(stdin) # if _MSC_VER>=1300 && _MSC_VER<1600