diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-05 14:36:29 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-10-05 14:36:29 -0700 |
| commit | a518ded266259141edd278e3f4025a3ab3211215 (patch) | |
| tree | 060532c62b474806a10ae777d53ed4502575c508 /toolsrc/src/vcpkg_System.cpp | |
| parent | d8507cd159f8de6ae174cae9894c926f75fe50d7 (diff) | |
| download | vcpkg-a518ded266259141edd278e3f4025a3ab3211215.tar.gz vcpkg-a518ded266259141edd278e3f4025a3ab3211215.zip | |
[vcpkg] Check size and don't perform stripping if string is too small.
Diffstat (limited to 'toolsrc/src/vcpkg_System.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg_System.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 4d2e88b73..7a6e7f028 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -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) |
