Skip to content

Commit

Permalink
fix stack corruption
Browse files Browse the repository at this point in the history
bad creation can set many (or all) points equal. Catch indices trying to
write past the arrays size.
  • Loading branch information
f4alt committed Aug 10, 2023
1 parent 2e66983 commit 6a81a2a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librt/primitives/arb8/arb8.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ rt_arb_get_cgtype(
for (j = i + 1; j < 8; j++) {
/* check if points are "equal" */
if (VNEAR_EQUAL(arb->pt[i], arb->pt[j], tol->dist)) {
if (si >= 10) break; /* too many equal points - can't write past array size */
svec[++si] = j;
unique = 0;
}
Expand Down

0 comments on commit 6a81a2a

Please sign in to comment.