uber / h3

Hexagonal hierarchical geospatial indexing system
https://h3geo.org
Apache License 2.0
4.91k stars 467 forks source link

Guard against potential out-of-bounds lookups in base cell tables #392

Open nrabinowitz opened 4 years ago

nrabinowitz commented 4 years ago

The functions in baseCells.c should guard against invalid base cell numbers that could result in out-of-bounds reads on the lookup tables.

alexey-milovidov commented 3 years ago

For zero-cost implementation (safe but implementation specific behaviour on out-of-bounds lookup) we can simply extend the arrays to 128 elements (filling the rest with zeros).