gpt: add overflow check for lba_first
This commit is contained in:
parent
9f71cabc9e
commit
57d9a4164f
1 changed files with 3 additions and 0 deletions
3
fs/gpt.c
3
fs/gpt.c
|
|
@ -55,6 +55,9 @@ void block_gpt_init(struct block_device *dev)
|
|||
|
||||
used_count++;
|
||||
|
||||
if(entries[i].lba_first > dev->block_count)
|
||||
continue;
|
||||
|
||||
/* Name and register the partition */
|
||||
char *buf = kzalloc(64, ALLOC_KERN);
|
||||
snprintf(buf, "%sp%d", 63, dev->name, used_count - 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue