diff options
author | Francois Gaffie <francois.gaffie@intel.com> | 2015-02-19 15:39:33 +0100 |
---|---|---|
committer | Francois Gaffie <francois.gaffie@intel.com> | 2015-02-19 16:56:31 +0100 |
commit | 770f8e13f7608b4b7f356c0bcf662ba6392b5c02 (patch) | |
tree | 536da0c8ee6fbd6074953c768525c49a448ada5a | |
parent | 4f03c87b6eedf3c4e38c55a4a831ef3c1f63ebc8 (diff) | |
download | external_parameter-framework-770f8e13f7608b4b7f356c0bcf662ba6392b5c02.zip external_parameter-framework-770f8e13f7608b4b7f356c0bcf662ba6392b5c02.tar.gz external_parameter-framework-770f8e13f7608b4b7f356c0bcf662ba6392b5c02.tar.bz2 |
Output parameter within getNumericalValue not initialized
When calling getNumericalValue on inclusive criterion, the value
to be outputed is never initialized. The Criterion type will append
the value corresponding to each literal value to the uninitialized value
leading to undefined behavior.
This patch initializes the output value.
Issue: GMINL-6007
Change-Id: Id9fc8b010b4d0b6dfc921825387817789d35e5ba
Signed-off-by: Francois Gaffie <francois.gaffie@intel.com>
-rw-r--r-- | parameter/SelectionCriterionType.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/parameter/SelectionCriterionType.cpp b/parameter/SelectionCriterionType.cpp index 95e8e46..2f17379 100644 --- a/parameter/SelectionCriterionType.cpp +++ b/parameter/SelectionCriterionType.cpp @@ -80,6 +80,7 @@ bool CSelectionCriterionType::getNumericalValue(const std::string& strValue, int uint32_t uiNbValues = astrValues.size(); int iResult = 0; uint32_t uiValueIndex; + iValue = 0; // Looping on each std::string delimited by "|" token and adding the associated value for (uiValueIndex = 0; uiValueIndex < uiNbValues; uiValueIndex++) { |