[parted-devel] [PATCH 1/2] parted: initialize align_type to default value

Petr Uzel petr.uzel at suse.cz
Wed May 26 12:27:07 UTC 2010


* parted/parted.c (do_align_check): initialize align_type to
default alignment; this prevents reading of uninitialized memory
later in command_line_get_align_type()
---
 parted/parted.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/parted/parted.c b/parted/parted.c
index 04d765c..830075b 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -2080,7 +2080,7 @@ do_align_check (PedDevice **dev)
   if (!disk)
     return 0;
 
-  enum AlignmentType align_type;
+  enum AlignmentType align_type = PA_OPTIMUM;
   PedPartition *part = NULL;
   bool aligned =
     (command_line_get_align_type (_("alignment type(min/opt)"), &align_type)
-- 
1.6.4.2


Petr

--
Petr Uzel
IRC: ptr_uzl @ freenode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20100526/d15dffe9/attachment.pgp>


More information about the parted-devel mailing list