aboutsummaryrefslogtreecommitdiff
path: root/tests/fs-tests/stress/atoms/Makefile
diff options
context:
space:
mode:
authorAnton Moryakov <ant.v.moryakov@gmail.com>2024-12-24 22:40:13 +0300
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2024-12-28 11:37:45 +0100
commit43b7c13c294d3aff771419ab9a924ee9a08725a8 (patch)
tree166c7549d95e467c9ea70baef80f81ec69928ef3 /tests/fs-tests/stress/atoms/Makefile
parentc01a38b3441b7a638137aa99c4ddd410a8dc4468 (diff)
ubi-utils: FIX DIVISION BY ZERO in ubinize.cHEADmaster
Report of the static analyzer: Variable vi->alignment, whose possible value set allows a zero value at ubinize.c:375, is used as a denominator at ubinize.c:410. If you look at the code more closely, it will be clear that the vi->alignment parameter is obtained from an external file passed as a command line argument. A check was also performed if you pass a test.ini file of the following type to the input: [jffs2-volume] mode=ubi image=../jffs2.img vol_id=1 vol_size=30MiB vol_type=dynamic vol_name=jffs2_volume vol_flags=autoresize vol_alignment=0 and execute the command: ./ubinize -o ubi.img -p 16KiB -m 512 -s 256 test.ini we will get the result: Floating point exception (core dumped) Corrections explained: Updated the validation logic for vi->alignment: - Replaced the check for negative alignment (`vi->id < 0`) with a more comprehensive check for non-positive alignment (`vi->alignment <= 0`). - Updated the corresponding error message to reflect the requirement for a positive volume alignment. This ensures more robust validation and improves error clarity when invalid alignment values are encountered. Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com> Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/fs-tests/stress/atoms/Makefile')
0 files changed, 0 insertions, 0 deletions