1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00

Cast MAJOR() and MINOR() to int when used with "%d" in dm_snprintf() call.

Fixes SEGV in _md_sysfs_attribute_snprintf() on 32-bit systems.
This commit is contained in:
snitzer 2009-07-20 18:33:16 +00:00
parent 35cf511d45
commit 0d8600ed6d

View File

@ -139,8 +139,8 @@ static int _md_sysfs_attribute_snprintf(char *path, size_t size,
if (!sysfs_dir || !*sysfs_dir)
return ret;
ret = dm_snprintf(path, size, "%s/dev/block/%d:%d/md/%s",
sysfs_dir, MAJOR(dev->dev), MINOR(dev->dev), attribute);
ret = dm_snprintf(path, size, "%s/dev/block/%d:%d/md/%s", sysfs_dir,
(int)MAJOR(dev->dev), (int)MINOR(dev->dev), attribute);
if (ret < 0) {
log_error("dm_snprintf md %s failed", attribute);
return ret;