mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
cov: guard index
Analyzer wants explicit protect to not underflow index.
This commit is contained in:
parent
d499491501
commit
b7edda8a98
@ -563,7 +563,7 @@ int module_present(struct cmd_context *cmd, const char *target_name)
|
||||
dm_sysfs_dir(), target_name);
|
||||
|
||||
if (i > 0) {
|
||||
while (path[--i] != '/') /* stop on dm_ */
|
||||
while ((i > 0) && path[--i] != '/') /* stop on dm_ */
|
||||
if (path[i] == '-')
|
||||
path[i] = '_'; /* replace '-' with '_' */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user