[parted-devel] [PATCH 1/2] parted: initialize align_type to default value
Jim Meyering
jim at meyering.net
Wed May 26 16:34:31 UTC 2010
Petr Uzel wrote:
> * 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)
Thank you.
Obviously correct. Applied.
More information about the parted-devel
mailing list