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
github-actions[bot] authored and nirvn committed Jan 29, 2020
1 parent e8a6c2b commit dc647bc
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 dc647bc

Please sign in to comment.