]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: Manage.c fix coverity issues
authorNigel Croxon <ncroxon@redhat.com>
Wed, 10 Jul 2024 12:55:08 +0000 (08:55 -0400)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Wed, 10 Jul 2024 14:15:21 +0000 (16:15 +0200)
commit1b4b73fd535a6487075e98f620454ff2e13b5240
treebe72a3e935c51a6b81ecd5a7d16e28fa74dedfb9
parent48c365376ce7763fd9a9e7735b1e9ec5d0ff1631
mdadm: Manage.c fix coverity issues

Fixing the following coding errors the coverity tools found:

* Event parameter_hidden: declaration hides parameter "dv".
* Event leaked_storage: Variable "mdi" going out of scope leaks the storage
it points to.
* Event overwrite_var: Overwriting "mdi" in "mdi = mdi->devs" leaks the
storage that "mdi" points to.
* Event leaked_handle: Handle variable "lfd" going out of scope leaks
the handle.
* Event leaked_handle: Returning without closing handle "fd" leaks it.
* Event fixed_size_dest: You might overrun the 32-character fixed-sizei
string "devnm" by copying the return value of "fd2devnm" without
checking the length.
* Event fixed_size_dest: You might overrun the 32-character fixed-size
string "nm" by copying "nmp" without checking the length.
* Event fixed_size_dest: You might overrun the 32-character fixed-size
string "devnm" by copying the return value of "fd2devnm" without
checking the length.
* Event assigned_value: Assigning value "-1" to "tfd" here, but that
stored value is overwritten before it can be used.

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