bliksemlabs / rrrr

RRRR rapid real-time routing
BSD 2-Clause "Simplified" License
164 stars 32 forks source link

Fix hashgrid initialization #188

Closed PaulWagener closed 9 years ago

PaulWagener commented 9 years ago

In the hashgrid the hg->bins is an array of pointers to hg->items. But due to a faulty initialization, the pointers in the highest bins after the final item point (one) outside the range of the hg->items array. If these bins are referenced a segfault can occur.

This change forces the bins pointers to stay within hg->items array.

skinkie commented 9 years ago

We still need some love in the Hashgrid unittest as well.

PaulWagener commented 9 years ago

Added the offending segfaulting test.