Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit b80adac

Browse files
committed
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 <[email protected]>
1 parent 84709c9 commit b80adac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parameter/Subsystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ bool CSubsystem::handleSubsystemObjectCreation(
440440
pSubsystemObjectCreator->getMaxConfigurableElementSize()) {
441441

442442
string strSizeError = "Size should not exceed " +
443-
pSubsystemObjectCreator->getMaxConfigurableElementSize();
443+
toString(pSubsystemObjectCreator->getMaxConfigurableElementSize());
444444

445445
strError = getMappingError(strKey, strSizeError, pInstanceConfigurableElement);
446446

0 commit comments

Comments
 (0)