epee: fix array underflow in unicode parsing

Reported by minerscan

Also independently found by OSS-Fuzz just recently
This commit is contained in:
moneromooo-monero 2020-04-23 14:39:54 +00:00
parent f0ada2f22b
commit 8eaf0e189f
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -196,7 +196,7 @@ namespace misc_utils
uint32_t dst = 0;
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");
dst = dst << 4 | tmp;
}