upgrade-apply: Modify to check th_get_size 46/317346/1 accepted/tizen/9.0/unified/20250102.114454
authorSangYoun Kwak <sy.kwak@samsung.com>
Tue, 31 Dec 2024 03:18:26 +0000 (12:18 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Tue, 31 Dec 2024 03:18:26 +0000 (12:18 +0900)
commit032fdb20703ec832f0e45043e626261e323fbcac
treeeeb3f231a32c8428c5e6636f4f2fae454c15c937
parenta7edc2277f0103cab39d032cc6a3b74cc3930aa1
upgrade-apply: Modify to check th_get_size

The return value of th_get_size() is int type, which means it can be
negative value. Previously, the lvalue of assignment was size_t, which
is unsigned integer while rvalue is the return value of th_get_size().
If the return value is positive, it is ok since size_t contains the
range of positive range of int type. But if it is negative it can be a
problem.(also it is an error)
To resolve this issue, a code to check if the return value is negative
or not before assigning it to size_t type variable.

Change-Id: I947484daca4722d3783964ffb98ea85255998164
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
src/upgrade-apply/patch/patch.c