Commit 10c0927bb3 for openssl.org
commit 10c0927bb398021f39adba04e371ee72cca1c724
Author: Mounir IDRASSI <mounir.idrassi@idrix.fr>
Date: Mon Jun 29 16:46:29 2026 +0900
Suppress MSVC C4996 in applink.c
applink.c deliberately stores legacy CRT function pointers because
ms/uplink.h expects the old fopen and _open signatures. Keep the
table entries unchanged and suppress MSVC warning C4996 locally
around OPENSSL_Applink() instead of switching to fopen_s or
_sopen_s.
Fixes #8241
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jul 1 09:17:39 2026
(Merged from https://github.com/openssl/openssl/pull/31765)
diff --git a/ms/applink.c b/ms/applink.c
index 4777d2e361..242b0bed74 100644
--- a/ms/applink.c
+++ b/ms/applink.c
@@ -103,6 +103,14 @@ static int app_fsetmod(FILE *fp, char mod)
extern "C" {
#endif
+/*
+ * The AppLink table exposes the legacy CRT signatures used by ms/uplink.h.
+ */
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4996)
+#endif
+
__declspec(dllexport) void **
#if defined(__BORLANDC__)
/*
@@ -151,6 +159,10 @@ __declspec(dllexport) void **
return OPENSSL_ApplinkTable;
}
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif