fix(kernel): fix empty initialization of std::string (str = "")

_size is 0 which fails the memcpy checks

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
EnderIce2 2025-02-27 18:13:51 +00:00
parent cfb5d9a0f4
commit ca8dc6429b
No known key found for this signature in database
GPG Key ID: 2EE20AF089811A5A

View File

@ -1013,7 +1013,7 @@ namespace std
_size = Traits::length(s);
_capacity = _size + 1;
_data = _alloc.allocate(_capacity);
memcpy(_data, s, _size);
memcpy(_data, s, _size > 0 ? _size : 1);
_data[_size] = '\0';
return *this;
}