Skip to content

Commit

Permalink
[Fix #7772] Check attribute index before setting attribute to avoid c…
Browse files Browse the repository at this point in the history
…rash
  • Loading branch information
m-kuhn committed May 7, 2013
1 parent c5142da commit 524e142
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/core/qgsfeature.cpp
Expand Up @@ -184,13 +184,11 @@ void QgsFeature::initAttributes( int fieldCount )

bool QgsFeature::setAttribute( int idx, const QVariant &value )
{
#ifdef QGISDEBUG
if ( idx < 0 || idx >= mAttributes.size() )
{
QgsMessageLog::logMessage( QObject::tr( "Attribute index %1 out of bounds [0;%2[" ).arg( idx ).arg( mAttributes.size() ), QString::null, QgsMessageLog::WARNING );
return false;
}
#endif

mAttributes[idx] = value;
return true;
Expand Down

0 comments on commit 524e142

Please sign in to comment.