Skip to content

Commit

Permalink
Fix potential crash in QGIS server
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 2, 2016
1 parent f2e8f2d commit 63208a2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/core/qgsogcutils.cpp
Expand Up @@ -1148,7 +1148,16 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry* geometry, QDomDocumen
bool hasZValue = false;

QgsConstWkbPtr wkbPtr( geometry->asWkb(), geometry->wkbSize() );
wkbPtr.readHeader();
try
{
wkbPtr.readHeader();
}
catch ( const QgsWkbException &e )
{
Q_UNUSED( e );
// WKB exception while reading header
return QDomElement();
}

if ( gmlVersion != GML_2_1_2 )
{
Expand Down

0 comments on commit 63208a2

Please sign in to comment.