Fixes for "vulnerable command line parsing"

Signed-off-by: Sergey G. Brester <info@sebres.de>
Reviewed-by: Tino Reichardt <milky-7zip@mcmilk.de>
This commit is contained in:
sebres
2023-04-06 20:04:55 +02:00
committed by Tino Reichardt
parent d94284915a
commit 8cfdd747c8
3 changed files with 100 additions and 22 deletions

View File

@@ -1206,6 +1206,16 @@ UString &UString::operator=(const UString &s)
return *this;
}
void UString::AddFrom(const wchar_t *s, unsigned len) // no check
{
if (len) {
Grow(len);
wmemcpy(_chars + _len, s, len);
_len += len;
_chars[_len] = 0;
}
}
void UString::SetFrom(const wchar_t *s, unsigned len) // no check
{
if (len > _limit)