lib: os: cbprintf: Fix size miscalculation in cbprintf_convert
When package contained RO string positions and flag indicates that they shall not be kept, length was miscalculated which could lead to failures (e.g. memory corruption). Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
b46d961abf
commit
c48d61a4b4
|
@ -982,9 +982,7 @@ int cbprintf_package_convert(void *in_packaged,
|
|||
str_pos++;
|
||||
}
|
||||
} else {
|
||||
if (ros_nbr && flags & CBPRINTF_PACKAGE_CONVERT_KEEP_RO_STR) {
|
||||
str_pos += ros_nbr;
|
||||
}
|
||||
str_pos += ros_nbr;
|
||||
}
|
||||
|
||||
bool drop_ro_str_pos = !(flags &
|
||||
|
|
Loading…
Reference in a new issue