diff options
author | Kevin Rocard <kevin.rocard@intel.com> | 2015-02-03 19:04:10 +0100 |
---|---|---|
committer | Kevin Rocard <kevin.rocard@intel.com> | 2015-02-16 11:42:43 +0100 |
commit | b80adacde950e64be8deee5399ddf6619c4f99bb (patch) | |
tree | 6de60a94519177ffe3e8cb718c153f50537b0cc8 /parameter | |
parent | 84709c9e1d35e54e51ece60c41ad640412b7bfca (diff) | |
download | external_parameter-framework-b80adacde950e64be8deee5399ddf6619c4f99bb.zip external_parameter-framework-b80adacde950e64be8deee5399ddf6619c4f99bb.tar.gz external_parameter-framework-b80adacde950e64be8deee5399ddf6619c4f99bb.tar.bz2 |
Fix pointer arithmetic instead of concat
`"my number " + 5` does not produces `"my number 5"` but rather `"mber "`.
If the number was greater than `len(string) + 2`
(pointing to the \0 and one past the end in authorized, more in UB)
the result would have been undefined behaviour.
Transforme the number to std::string using toString.
Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Diffstat (limited to 'parameter')
-rw-r--r-- | parameter/Subsystem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/parameter/Subsystem.cpp b/parameter/Subsystem.cpp index 28faa01..fc54695 100644 --- a/parameter/Subsystem.cpp +++ b/parameter/Subsystem.cpp @@ -440,7 +440,7 @@ bool CSubsystem::handleSubsystemObjectCreation( pSubsystemObjectCreator->getMaxConfigurableElementSize()) { string strSizeError = "Size should not exceed " + - pSubsystemObjectCreator->getMaxConfigurableElementSize(); + toString(pSubsystemObjectCreator->getMaxConfigurableElementSize()); strError = getMappingError(strKey, strSizeError, pInstanceConfigurableElement); |