mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 03:40:24 +00:00
Fix out of bounds access for std::string_view
This commit is contained in:
parent
72e76ad820
commit
071ab3f650
1 changed files with 2 additions and 0 deletions
|
@ -30,6 +30,8 @@ namespace
|
||||||
{
|
{
|
||||||
unsigned long utf8ToUnicode(std::string_view utf8)
|
unsigned long utf8ToUnicode(std::string_view utf8)
|
||||||
{
|
{
|
||||||
|
if (utf8.empty())
|
||||||
|
return 0;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
unsigned long unicode;
|
unsigned long unicode;
|
||||||
size_t numbytes;
|
size_t numbytes;
|
||||||
|
|
Loading…
Reference in a new issue