[mapguide-trac] #1824: Calling CCoordinateSystemTransform::GetGeodeticTransformation() causes Assertion in debug mode and/or is prone to access violations

MapGuide Open Source trac_mapguide at osgeo.org
Mon Oct 3 14:57:29 EDT 2011


#1824: Calling CCoordinateSystemTransform::GetGeodeticTransformation() causes
Assertion in debug mode and/or is prone to access violations
---------------------------+------------------------------------------------
   Reporter:  baertelchen  |       Owner:  baertelchen                                                                                               
       Type:  defect       |      Status:  new                                                                                                       
   Priority:  low          |   Milestone:  2.3                                                                                                       
  Component:  General      |     Version:  2.1.0                                                                                                     
   Severity:  trivial      |    Keywords:  CoordinateSystem API MgCoordinateSystemTransform GetGeodeticTransformation NumberOfGeodeticTransformations
External_id:               |  
---------------------------+------------------------------------------------
 The code in CCoordinateSystemTransform::GetGeodeticTransformation() sets
 an emtpy wstring object to '\0' at index 0 what causes an assertion in
 debug mode.

 Not even that setting the string to "empty" is unnecessary, it's also
 prone to access violations in release builds.

 Also, the documentation says "...Returns a disposable pointer to the
 geodetic transformation definition indicated by the index parameter.  A
 null pointer is returned if the index parameter is zero..."

 Passing in 0 is absolutely valid, however.

 This ticket is about fixing 2 things:
 - the documentation of the methods [NumberOfGeodeticTransformations] and
 [GetGeodeticTransformation]
 - remove / fix the implementation of [GetGeodeticTransformation] so it
 least doesn't resets the empty string via the indexing parameter

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1824>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list