From bbb2a70f51732b63d64e2d927c6a6536b01dd175 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 16 Sep 2009 19:23:33 +0000 Subject: [PATCH] 2009-09-16 Robert Millan * partmap/msdos.c (pc_partition_map_iterate): Fix possible use of uninitialized `lastaddr'. --- ChangeLog | 5 +++++ partmap/msdos.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c8f1b9cbf..722f55c3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-16 Robert Millan + + * partmap/msdos.c (pc_partition_map_iterate): Fix possible use of + uninitialized `lastaddr'. + 2009-09-15 Vladimir Serbinenko * partmap/msdos.c (pc_partition_map_iterate): Detect and break loops. diff --git a/partmap/msdos.c b/partmap/msdos.c index a5d55b64d..6ba7fb927 100644 --- a/partmap/msdos.c +++ b/partmap/msdos.c @@ -110,6 +110,10 @@ pc_partition_map_iterate (grub_disk_t disk, p.data = &pcdata; p.partmap = &grub_msdos_partition_map; + /* Any value different than `p.offset' will satisfy the check during + first loop. */ + lastaddr = !p.offset; + while (1) { int i;