Browse Source

Return Utf8DecodeError when passed an incomplete code point

Also ensure that len set in all code paths, otherwise it leads to a call to remove_prefix with garbage.
pull/3566/head
ephphatha 4 years ago committed by Gleb Mazovetskiy
parent
commit
c206b7cce8
  1. 3
      Source/utils/utf8.cpp

3
Source/utils/utf8.cpp

@ -21,7 +21,8 @@ char32_t DecodeFirstUtf8CodePoint(string_view input, uint8_t *len)
return Utf8DecodeError;
}
}
return codepoint;
*len = input.size();
return Utf8DecodeError;
}
} // namespace devilution

Loading…
Cancel
Save