Skip to content
Permalink
Browse files

Fix crash in QgsGeometryDuplicateCheck due to heap use after free

  • Loading branch information
github-actions authored and nirvn committed Jan 29, 2020
1 parent e8a6c2b commit dc647bc56fb37207a75d55638926e7a2db75a8be
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/analysis/vector/geometry_checker/qgsgeometryduplicatecheck.cpp
@@ -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 ) )

0 comments on commit dc647bc

Please sign in to comment.
You can’t perform that action at this time.