linux/hostdisk: Limit strcpy size to buffer size.
Found by: Coverity scan.
This commit is contained in:
parent
916733ea6a
commit
c2fc41990a
1 changed files with 2 additions and 2 deletions
|
@ -376,7 +376,7 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f
|
|||
|
||||
part_start = grub_partition_get_start (disk->partition);
|
||||
|
||||
strcpy (dev, grub_util_biosdisk_get_osdev (disk));
|
||||
strlcpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev));
|
||||
if (disk->partition
|
||||
&& strncmp (dev, "/dev/", 5) == 0)
|
||||
{
|
||||
|
@ -439,7 +439,7 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f
|
|||
if (*max == 0)
|
||||
*max = ~0ULL;
|
||||
is_partition = 0;
|
||||
strcpy (dev, grub_util_biosdisk_get_osdev (disk));
|
||||
strlcpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev));
|
||||
goto reopen;
|
||||
}
|
||||
sector -= part_start;
|
||||
|
|
Loading…
Reference in a new issue