]> www.infradead.org Git - mtd-utils.git/commit
mtd-utils: Fix potential negative arguments passed to close(2)
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Fri, 24 Jan 2020 22:01:57 +0000 (23:01 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Sun, 9 Feb 2020 21:13:18 +0000 (22:13 +0100)
commitb636250e211198210ab996671bccc2983300c6f5
treeda1793fcd90dfd2b411afc1bc7cc2249b47c8e4f
parent11bc41c32cc933a141545be6a9729122ac436cfe
mtd-utils: Fix potential negative arguments passed to close(2)

Many tools open a file descriptor, close it a the end and have some
form of error path in between that jumps to the end.

In some cases, if opening the file fails the error path is taken and
the utility ends up closing one or more invalid file descriptors. It's
technically not a real issue but something that pretty much any static
analysis tool barks at.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
nand-utils/nanddump.c
nand-utils/nandwrite.c
nor-utils/rfddump.c
tests/fs-tests/stress/atoms/fwrite00.c