aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-04-23 14:39:54 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-06-21 18:23:03 +0000
commit8eaf0e189fdd9ae5d338a38e4fec9cdc743f0952 (patch)
tree35ea376d090f4f4c0d4abc63c9749585812aad23
parentMerge pull request #6648 (diff)
downloadmonero-8eaf0e189fdd9ae5d338a38e4fec9cdc743f0952.tar.xz
epee: fix array underflow in unicode parsing
Reported by minerscan Also independently found by OSS-Fuzz just recently
-rw-r--r--contrib/epee/include/storages/parserse_base_utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/epee/include/storages/parserse_base_utils.h b/contrib/epee/include/storages/parserse_base_utils.h
index 2256f6b83..5a6cc0b51 100644
--- a/contrib/epee/include/storages/parserse_base_utils.h
+++ b/contrib/epee/include/storages/parserse_base_utils.h
@@ -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;
}