Merge pull request #6676

8eaf0e1 epee: fix array underflow in unicode parsing (moneromooo-monero)
This commit is contained in:
luigi1111 2020-06-22 14:25:19 -05:00
commit efe1bfe7a1
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -196,7 +196,7 @@ namespace misc_utils
uint32_t dst = 0; uint32_t dst = 0;
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
{ {
const unsigned char tmp = isx[(int)*++it]; const unsigned char tmp = isx[(unsigned char)*++it];
CHECK_AND_ASSERT_THROW_MES(tmp != 0xff, "Bad Unicode encoding"); CHECK_AND_ASSERT_THROW_MES(tmp != 0xff, "Bad Unicode encoding");
dst = dst << 4 | tmp; dst = dst << 4 | tmp;
} }