1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Fix major number filter structure boundary test.

This commit is contained in:
Milan Broz 2011-11-11 16:59:30 +00:00
parent a3390bb507
commit 64f1fd749f

View File

@ -319,7 +319,7 @@ static int _scan_proc_dev(const char *proc, const struct dm_config_node *cn)
int max_partitions(int major) int max_partitions(int major)
{ {
if (major > NUMBER_OF_MAJORS) if (major >= NUMBER_OF_MAJORS)
return 0; return 0;
return _partitions[major].max_partitions; return _partitions[major].max_partitions;
@ -327,7 +327,7 @@ int max_partitions(int major)
int major_is_scsi_device(int major) int major_is_scsi_device(int major)
{ {
if (major > NUMBER_OF_MAJORS) if (major >= NUMBER_OF_MAJORS)
return 0; return 0;
return (_partitions[major].flags & PARTITION_SCSI_DEVICE) ? 1 : 0; return (_partitions[major].flags & PARTITION_SCSI_DEVICE) ? 1 : 0;