2008-05-29 Pavel Roskin <proski@gnu.org>
* disk/lvm.c (grub_lvm_scan_device): Check for the buffer end when scanning metadata for volume group name.
This commit is contained in:
parent
528ad8f272
commit
d1dff95dc7
2 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
2008-05-29 Pavel Roskin <proski@gnu.org>
|
2008-05-29 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* disk/lvm.c (grub_lvm_scan_device): Check for the buffer end
|
||||||
|
when scanning metadata for volume group name.
|
||||||
|
|
||||||
* include/grub/script.h: Don't include grub_script.tab.h. It's
|
* include/grub/script.h: Don't include grub_script.tab.h. It's
|
||||||
a generated file, which may only be included from the files with
|
a generated file, which may only be included from the files with
|
||||||
DEPENDENCIES rules in the makefile. Don't use typedef YYSTYPE,
|
DEPENDENCIES rules in the makefile. Don't use typedef YYSTYPE,
|
||||||
|
|
|
@ -302,9 +302,12 @@ grub_lvm_scan_device (const char *name)
|
||||||
rlocn = mdah->raw_locns;
|
rlocn = mdah->raw_locns;
|
||||||
p = q = metadatabuf + grub_le_to_cpu64 (rlocn->offset);
|
p = q = metadatabuf + grub_le_to_cpu64 (rlocn->offset);
|
||||||
|
|
||||||
while (*q != ' ')
|
while (*q != ' ' && q < metadatabuf + mda_size)
|
||||||
q++;
|
q++;
|
||||||
|
|
||||||
|
if (q == metadatabuf + mda_size)
|
||||||
|
goto fail2;
|
||||||
|
|
||||||
vgname_len = q - p;
|
vgname_len = q - p;
|
||||||
vgname = grub_malloc (vgname_len + 1);
|
vgname = grub_malloc (vgname_len + 1);
|
||||||
if (!vgname)
|
if (!vgname)
|
||||||
|
|
Loading…
Reference in a new issue