[openssl/openssl] 79f0d3: Fix C99 printf length modifiers with VS2013 CRT

"'Mounir IDRASSI' via openssl-commits" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/openssl-4.0/[email protected]>
  Branch: refs/heads/openssl-4.0
  Home:   https://github.com/openssl/openssl
  Commit: 79f0d356fcfcb73e150ff8b96754f25599240d15
      https://github.com/openssl/openssl/commit/79f0d356fcfcb73e150ff8b96754f25599240d15
  Author: Mounir IDRASSI <[email protected]>
  Date:   2026-08-21 (Fri, 21 Aug 2026)

  Changed paths:
    M crypto/bio/bio_print.c
    M test/bio_core_test.c

  Log Message:
  -----------
  Fix C99 printf length modifiers with VS2013 CRT

The Visual Studio 2013 CRT does not support the C99 z, t and j length modifiers. Passing such formats to _vsnprintf_s invokes the invalid-parameter path and normally terminates the process.

For _MSC_VER < 1900, translate z and t to the pointer-sized I modifier and j to I64 before calling the CRT. Allocate a translated format only when needed, leaving newer MSVC versions and unaffected formats unchanged. Delegate BIO_snprintf to BIO_vsnprintf so all BIO formatting entry points use the same compatibility path.

Add focused coverage for BIO_snprintf, BIO_vsnprintf and BIO_printf, including the large-output allocation path and truncation behavior.

Fixes #31645

Assisted-by: OpenCode:GLM-5.2

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
MergeDate: Fri Jul 31 13:13:06 2026
Reviewed-by: Bob Beck <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
Merged-from: https://github.com/openssl/openssl/pull/32419


  Commit: 016c52388792da2ae721b97f2c70dc70e83138dc
      https://github.com/openssl/openssl/commit/016c52388792da2ae721b97f2c70dc70e83138dc
  Author: Mounir IDRASSI <[email protected]>
  Date:   2026-08-21 (Fri, 21 Aug 2026)

  Changed paths:
    M test/radix/quic_tests.c

  Log Message:
  -----------
  Fix VS2013 build of QUIC radix tests

Visual Studio 2013 does not provide the C99 __func__ predefined identifier in C mode. Use OPENSSL_FUNC, which maps to the compiler-supported equivalent.

This is the only source change required to compile current master with VS2013 Update 5 (cl 18.00.40629), on both x86 and x64.

Assisted-by: OpenCode:GLM-5.2

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
MergeDate: Fri Jul 31 13:13:04 2026
Reviewed-by: Bob Beck <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
Merged-from: https://github.com/openssl/openssl/pull/32419


Compare: https://github.com/openssl/openssl/compare/19720bf9a30f...016c52388792

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/openssl-4.0/19720b-016c52%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.