mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-17 05:21:05 +08:00
[vcpkg] Check size and don't perform stripping if string is too small.
This commit is contained in:
parent
d8507cd159
commit
a518ded266
@ -179,6 +179,7 @@ namespace vcpkg::System
|
||||
// On Win7, output from powershell calls contain a byte order mark, so we strip it out if it is present
|
||||
static void remove_byte_order_mark(std::wstring* s)
|
||||
{
|
||||
if (s->size() < 3) return;
|
||||
const wchar_t* a = s->c_str();
|
||||
// This is the UTF-8 byte-order mark
|
||||
if (a[0] == 0xEF && a[1] == 0xBB && a[2] == 0xBF)
|
||||
|
Loading…
x
Reference in New Issue
Block a user