From a4acf026ec92de423829d26f9988ef7f0d886c6f Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Wed, 4 Jun 2025 15:48:45 -0400 Subject: [PATCH] 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) --- include/internal/e_os.h | 11 ----------- 1 file changed, 11 deletions(-) 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 -- 2.47.2