1
0
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:
Zdenek Kabelac 2021-07-27 15:53:48 +02:00
parent d499491501
commit b7edda8a98

View File

@ -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 '_' */