Skip to content

Commit

Permalink
Fix crash in QgsGeometryDuplicateCheck due to heap use after free
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 29, 2020
1 parent 7508116 commit 195576e
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -107,10 +107,13 @@ void QgsGeometryDuplicateCheck::fixError( const QMap<QString, QgsFeaturePool *>
std::unique_ptr< QgsGeometryEngine > geomEngineA = QgsGeometryCheckerUtils::createGeomEngine( layerFeatureA.geometry().constGet(), mContext->tolerance );

QgsGeometryDuplicateCheckError *duplicateError = static_cast<QgsGeometryDuplicateCheckError *>( error );
for ( const QString &layerIdB : duplicateError->duplicates().keys() )
const QMap<QString, QList<QgsFeatureId>> duplicates = duplicateError->duplicates();
for ( auto it = duplicates.constBegin(); it != duplicates.constEnd(); ++it )
{
const QString layerIdB = it.key();
QgsFeaturePool *featurePoolB = featurePools[ layerIdB ];
for ( QgsFeatureId idB : duplicateError->duplicates()[layerIdB] )
const QList< QgsFeatureId > ids = it.value();
for ( QgsFeatureId idB : ids )
{
QgsFeature featureB;
if ( !featurePoolB->getFeature( idB, featureB ) )
Expand Down

0 comments on commit 195576e

Please sign in to comment.