Repository navigation
Fix reading uninitialized memory in polygonConvexHullCartesian - #127015
Conversation
`boost::geometry::convex_hull` builds the hull only from exterior rings, but checks the input for emptiness with `boost::geometry::is_empty`, which also looks at interior rings. For a polygon with an empty exterior ring and a non-empty interior ring it read uninitialized points and returned garbage. MemorySanitizer reported it in the AST fuzzer (STID 1401-309d). Return an empty polygon when there are no exterior ring points. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=629df3319f3cfc7d3adba3f078de4061f9e39399&name_0=MasterCI&name_1=AST%20fuzzer%20%28amd_msan%29 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [fd688ae] Summary: ✅
AI ReviewSummaryThe change makes Missing context / blind spots
Final VerdictStatus: ✅ Approve. No changes requested. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 12 s compile time in total, 7 of them have a recent master baseline. |
Backport #127015 to 26.10: Fix reading uninitialized memory in `polygonConvexHullCartesian`
Backport #127015 to 26.9: Fix reading uninitialized memory in `polygonConvexHullCartesian`
Backport #127015 to 26.8: Fix reading uninitialized memory in `polygonConvexHullCartesian`
Backport #127015 to 26.3: Fix reading uninitialized memory in `polygonConvexHullCartesian`
…in `polygonConvexHullCartesian`
Backport #127015 to 26.7: Fix reading uninitialized memory in `polygonConvexHullCartesian`
boost::geometry::convex_hullbuilds the hull only from exterior rings, but checks the input for emptiness withboost::geometry::is_empty, which also looks at interior rings. For a polygon with an empty exterior ring and a non-empty interior ring, it read uninitialized points and returned garbage, e.g.polygonConvexHullCartesian([[[], [(0., 0.), (1., 1.)]]]::MultiPolygon)returned[[(1.258857864326815e-309,2.37e-322),...]], different on every run. MemorySanitizer reported it in the AST fuzzer (STID 1401-309d): https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=629df3319f3cfc7d3adba3f078de4061f9e39399&name_0=MasterCI&name_1=AST%20fuzzer%20%28amd_msan%29Now an empty polygon is returned when there are no exterior ring points.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
polygonConvexHullCartesianreturning garbage for a polygon with an empty exterior ring and a non-empty interior ring.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127015]
Version info
26.11.1.384-master(included in26.11and later)26.10.2.55,26.9.24.9,26.8.33.9,26.7.38.12,26.3.58.6