SIGN IN SIGN UP

Check string size before Win32 MultiByte <-> WideChar conversions (#99729)

This patch adds an additional check to ensure the target length of a string is within the supported maximum string length prior to calling WideCharToMultiByte/MultiByteToWideChar in the Windows runner template.

This is to prevent resize() from failing if called with a count > std::string::max_size().

According to Win32 API docs (WideCharToMultiByte, MultiByteToWideChar) it's the caller responsibility to make sure the buffers are correctly allocated.

Authored by: Tomasz Gucio <tgucio@gmail.com>
C
Chris Bracken committed
b5d3c43280bba8bc5f57ef63798a577b97558be0
Parent: dfd8bde
Committed by GitHub <noreply@github.com> on 3/8/2022, 3:57:36 AM