boostorg / boostorg/geometry

Potential overflow in rare cases

Open
#1,031 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
517
Forks
232
PR merge metrics
No merged PRs in 30d

Description

See comments in #1028

We have now:
`promoted_type const dx = get<0>(p) - get<0>(vertex);`

which could overflow if p is negative and huge, and vertex is positive and huge (or vv). But in buffer, that won't occur (coordinates of offset point and vertex are not that far apart).

We could first convert them to promoted type. This functionality is shared anyway (buffer_side_straight, buffer_join_round_by_divide, buffer_join_miter) and specific for cartesian only. So we can move it to a separate function and fix it once there.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.