Skip to content
Permalink
Browse files

[Fix #7772] Check attribute index before setting attribute to avoid c…

…rash
  • Loading branch information
m-kuhn committed May 7, 2013
1 parent c5142da commit 524e142e1178cfd50fbeb3b178fe26c2818b3fe3
Showing with 0 additions and 2 deletions.
  1. +0 −2 src/core/qgsfeature.cpp
@@ -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;

0 comments on commit 524e142

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