keymap: Fix crash introduced by 637ecdb

Just because a Vector has some inline capacity doesn't mean we can put
data at offsets < Vector::size().

Fixes #2104.
This commit is contained in:
Andreas Kling 2020-05-05 00:11:21 +02:00
parent 454c1e6bbe
commit 7dd49047f3
Notes: sideshowbarker 2024-07-19 06:59:08 +09:00

View file

@ -44,6 +44,7 @@ static Vector<char> read_map(const JsonObject& json, const String& name)
return {};
Vector<char, 0x80> map;
map.resize(0x80);
auto map_arr = json.get(name).as_array();
for (int i = 0; i < map_arr.size(); i++) {