mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 19:21:04 +00:00
Merge branch 'fix_empty_utf8' into 'master'
Fix out of bounds access for std::string_view See merge request OpenMW/openmw!1658
This commit is contained in:
commit
b617d0aec4
@ -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…
x
Reference in New Issue
Block a user