#4173 closed defect (fixed)
Undefined behaviour in ptarray_segmentize2d
Reported by: | Algunenano | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.5.0 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
It comes from test test_lwgeom_segmentize2d
:
linein = lwgeom_from_wkt("LINESTRING(0 0,10 0)", LW_PARSER_CHECK_NONE); lwgeom_request_interrupt(); lineout = lwgeom_segmentize2d(linein, 1e-100); CU_ASSERT_EQUAL(lineout, NULL); lwgeom_free(linein);
$ ./cunit/.libs/lt-cu_tester test_lwgeom_segmentize2d Running test 'test_lwgeom_segmentize2d' in suite 'measures'. ptarray.c:450:10: runtime error: 1e+101 is outside the range of representable values of type 'unsigned int'
I'll need to check if it affects both 3.0 and 2.5.
I feel that the code is probably filled with these kind of issues (unsafe casting from double to integer types), but since those are corner cases I'll limit myself to fix whatever comes up when running unit tests.
Note:
See TracTickets
for help on using tickets.
In 16723: