Skip to content

Commit

Permalink
fix potential heap overflow in polygonToCellsExperimental due to unde…
Browse files Browse the repository at this point in the history
…r-estimation (#934)
  • Loading branch information
isaacbrodsky authored Oct 22, 2024
1 parent 09d96cd commit a99f03e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/h3lib/lib/polyfill.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ void iterStepPolygonCompact(IterCellsPolygonCompact *iter) {
// For overlap, we've already checked for center point inclusion
// above; if that failed, we only need to check for line
// intersection
else if (mode == CONTAINMENT_OVERLAPPING &&
else if ((mode == CONTAINMENT_OVERLAPPING ||
mode == CONTAINMENT_OVERLAPPING_BBOX) &&
cellBoundaryCrossesPolygon(
iter->_polygon, iter->_bboxes, &boundary, &bbox)) {
// Set to next output
Expand Down

0 comments on commit a99f03e

Please sign in to comment.