Skip to content

Commit

Permalink
Fix overflow exception when serializing
Browse files Browse the repository at this point in the history
  • Loading branch information
t5scc committed Mar 9, 2023
1 parent 9c65488 commit f0d45a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Release/src/utilities/asyncrt_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ inline size_t count_utf16_to_utf8(const utf16string& w)
throw std::range_error("UTF-16 string is missing low surrogate");
}

const auto lowSurrogate = srcData[index];
const auto lowSurrogate = static_cast<int>(srcData[index]);
if (lowSurrogate < L_SURROGATE_START || lowSurrogate > L_SURROGATE_END)
{
throw std::range_error("UTF-16 string has invalid low surrogate");
Expand Down

0 comments on commit f0d45a4

Please sign in to comment.