[Qgis-developer] Can I change QgsAbstractGeometryV2::fromWkb signature ?

Matthias Kuhn matthias at opengis.ch
Tue Jan 26 04:52:41 PST 2016


I would add a second method with size param and deprecate the current one.
This way we can prepare our own code and remove the dangerous method in 3.0

Matthias

On 01/26/2016 01:00 PM, Nathan Woodrow wrote:
> I think as long as you can make it optional then it doesn't break any
> of the APIs and should be fine.
>
> That is just my thoughts.  Maybe see what others think first before
> doing it.
>
> On Tue, Jan 26, 2016 at 9:22 PM, Sandro Santilli <strk at keybit.net
> <mailto:strk at keybit.net>> wrote:
>
>     I've been watching memory corruptions happening during WKB parsing [1]
>     and found the internal QgsAbstractGeometryV2::fromWkb method not
>     taking a size parameter to allow preventing such memory errors from
>     occurring. This needs be changed before it spreads too much !
>
>     The current method is virtual:
>
>       virtual bool fromWkb( const unsigned char * wkb ) = 0;
>
>     It'll need to be changed to take a size parameter.
>
>     Is that something we can do for this upcoming release or should
>     we just hope all our WKB providers will pass us good WKB ?
>
>     Note this all started from OGR giving a WKB which may even be
>     considered valid but our parser did not expect (3D components
>     inside a marked-to-be-2D collection).
>
>     [1] http://hub.qgis.org/issues/12416
>
>     --strk;
>     _______________________________________________
>     Qgis-developer mailing list
>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>     List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>     Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Matthias Kuhn
OPENGIS.ch - https://www.opengis.ch
Spatial • (Q)GIS • PostGIS • Open Source

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160126/eff8ec61/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160126/eff8ec61/attachment.sig>


More information about the Qgis-developer mailing list