1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: validate major and minor

Check  major and minor is >= 0.
This commit is contained in:
Zdenek Kabelac 2024-03-28 23:37:51 +01:00
parent 93a633092a
commit ee496f2846

View File

@ -880,6 +880,11 @@ static int _get_args(struct cmd_context *cmd, int argc, char **argv,
continue;
}
if ((major < 0) || (minor < 0)) {
log_warn("WARNING: Invalid major:minor %d:%d, skipping.", major, minor);
continue;
}
if (!(arg = dm_pool_zalloc(cmd->mem, sizeof(*arg))))
return_0;
arg->devno = MKDEV(major, minor);