dynamic-partitions: Modify to cast before multiply 89/307189/1 accepted/tizen/unified/20240307.075324 accepted/tizen/unified/toolchain/20240311.065624 accepted/tizen/unified/x/20240308.033508
authorSangYoun Kwak <sy.kwak@samsung.com>
Wed, 6 Mar 2024 02:27:50 +0000 (11:27 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Wed, 6 Mar 2024 02:45:39 +0000 (11:45 +0900)
commitf035989a7e8f4e779630d97dfdca9753c16336fb
treebea18aaf607ec93a2edeb31dfe413785150ef876
parentc67964306553378ebef7003155823ccdda7f126b
dynamic-partitions: Modify to cast before multiply

Previously, some variables(which are int32_t) are multiplied then casted
to int64_t. It is pointless since it can cause casting after overflow.
To prevent overflow, expression is modified to cast first operand and
then perform multiplication.

This solves a bug reported by SVACE with the following WGIDs:
701511 701817 701826 711926

Change-Id: Ic51b4f608d36850162e42330a7162e41e4b73f6e
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
src/dynamic-partitions/liblp/utility.cpp
src/dynamic-partitions/testlib/metadataio.cpp