From b80adacde950e64be8deee5399ddf6619c4f99bb Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Tue, 3 Feb 2015 19:04:10 +0100 Subject: 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 --- parameter/Subsystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parameter') 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); -- cgit v1.1