Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initialize all members in Interval constructor.
Fixes memory conditional jumps depending on uninitialized values
and as a consequence the unstable results from qgis_expressiontest

Closes #6877
  • Loading branch information
Sandro Santilli committed Dec 14, 2012
1 parent 677095f commit bd00b0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgsexpression.h
Expand Up @@ -358,7 +358,7 @@ class CORE_EXPORT QgsExpression
static const int HOUR = 60 * 60;
static const int MINUTE = 60;
public:
Interval( double seconds = 0 ) { mSeconds = seconds; }
Interval( double seconds = 0 ): mSeconds(seconds), mValid(true) { }
~Interval();
double years() { return mSeconds / YEARS;}
double months() { return mSeconds / MONTHS; }
Expand Down

0 comments on commit bd00b0f

Please sign in to comment.