haoel / leetcode

LeetCode Problems' Solutions
17.58k stars 4.91k forks source link

Fix possible out of bound array access #254

Closed zhao-gang closed 2 years ago

zhao-gang commented 3 years ago

Should check array size before accessing the second to fourth bytes of utf8 as there might be not enough data left in the array.