]> www.infradead.org Git - mtd-utils.git/commit
mtd-utils: Fix some simple cases of uninitialized value reads
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Fri, 24 Jan 2020 22:40:45 +0000 (23:40 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Sun, 9 Feb 2020 21:13:18 +0000 (22:13 +0100)
commit24b0e6277b36c46075e2e23896aa9ec43729efab
treeaee635ca55a8b59f1551734eb93dac6a3a7239fa
parent4233a39933277b0d715d59d72942a8fd65bcec4a
mtd-utils: Fix some simple cases of uninitialized value reads

This patch modifies the internal helpers to read and parse integers
from sysfs files by initializing them first and removes turns an
obscure "a = open(...) if (a >= 0) {...} if (a == -1) {...}" inside
recv_image into a more straight forward if/else branch.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
lib/libmtd.c
lib/libubi.c
misc-utils/recv_image.c