]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: util.c fix coverity issues
authorNigel Croxon <ncroxon@redhat.com>
Wed, 7 Aug 2024 15:33:23 +0000 (11:33 -0400)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Tue, 13 Aug 2024 11:39:02 +0000 (13:39 +0200)
commitea076e7c4bc8b3122ad9d7131098c4b85902a299
tree98a18748aee0e658d25c5225e22932013881ef90
parent1f49ecbf3d2ab8003d37eb1c0454c5cfbe335ee5
mdadm: util.c fix coverity issues

Fixing the following coding errors the coverity tools found:

* Event check_return: Calling "open" without checking return value
* Event check_return: Calling "lseek(fd, sector_size, 0)" without
checking return value.
* Event leaked_handle: Handle variable "fd" going out of scope leaks
the handle.
* Event leaked_storage: Variable "dir" going out of scope leaks the
storage it points to.
* Event fixed_size_dest: You might overrun the 32-character fixed-size
string "st->devnm" by copying "_devnm" without checking the length.
* Event fixed_size_dest: You might overrun the 32-character fixed-size
string "container" by copying "dev" without checking the length.

Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
util.c