[postgis-tickets] [PostGIS] #4031: ST_CurveToLine with small tolerance sometimes causes invalid memory alloc request size

PostGIS trac at osgeo.org
Tue Apr 24 05:54:40 PDT 2018


#4031: ST_CurveToLine with small tolerance sometimes causes invalid memory alloc
request size
----------------------+----------------------------
  Reporter:  kkgeodk  |      Owner:  strk
      Type:  defect   |     Status:  assigned
  Priority:  medium   |  Milestone:  PostGIS 2.5.0
 Component:  postgis  |    Version:  2.2.x
Resolution:           |   Keywords:  ST_CurveToLine
----------------------+----------------------------

Comment (by strk):

 Ok I know what's happening here.
 The arc radius is 0.191861, so the sagitta (max distance between arc and
 cord) can be at most .383722. We're doing the computation using a distance
 of 1 instead (the tolerance) which results in 1-tolerance/radius to give
 an invalid input value for acos. This should be fixed by limiting the used
 value to always be at most the max possible error (arc diameter).

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4031#comment:9>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list