Skip to content

Commit

Permalink
2008-05-29 Pavel Roskin <[email protected]>
Browse files Browse the repository at this point in the history
	* disk/lvm.c (grub_lvm_scan_device): Check for the buffer end
	when scanning metadata for volume group name.
  • Loading branch information
proski committed May 30, 2008
1 parent a06c4a3 commit a258d3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2008-05-29 Pavel Roskin <[email protected]>

* 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
a generated file, which may only be included from the files with
DEPENDENCIES rules in the makefile. Don't use typedef YYSTYPE,
Expand Down
5 changes: 4 additions & 1 deletion disk/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,12 @@ grub_lvm_scan_device (const char *name)
rlocn = mdah->raw_locns;
p = q = metadatabuf + grub_le_to_cpu64 (rlocn->offset);

while (*q != ' ')
while (*q != ' ' && q < metadatabuf + mda_size)
q++;

if (q == metadatabuf + mda_size)
goto fail2;

vgname_len = q - p;
vgname = grub_malloc (vgname_len + 1);
if (!vgname)
Expand Down

0 comments on commit a258d3a

Please sign in to comment.