gpt_write: fix a write-uninitialized error
* libparted/labels/gpt.c (gpt_partition_new):
==32570== Syscall param write(buf) points to uninitialised byte(s)
==32570== at 0x36CF8D6540: __write_nocancel (in /lib64/libc-2.8.so)
==32570== by 0x443D29: linux_write (linux.c:1642)
==32570== by 0x414E4E: ped_device_write (device.c:370)
==32570== by 0x4404CE: gpt_write (gpt.c:1091)
==32570== by 0x418F16: ped_disk_commit_to_dev (disk.c:486)
==32570== by 0x418F5C: ped_disk_commit (disk.c:509)
==32570== by 0x40BAD6: do_mkpartfs (parted.c:981)
==32570== by 0x40A035: command_run (command.c:139)
==32570== by 0x412150: non_interactive_mode (ui.c:1540)
==32570== by 0x40EE83: main (parted.c:2487)
==32570== Address 0x501b63a is 58 bytes inside a block of size 16,384 alloc'd
==32570== at 0x4A04FC0: memalign (vg_replace_malloc.c:460)
==32570== by 0x4A0507A: posix_memalign (vg_replace_malloc.c:569)
==32570== by 0x443CED: linux_write (linux.c:1637)
==32570== by 0x414E4E: ped_device_write (device.c:370)
==32570== by 0x4404CE: gpt_write (gpt.c:1091)
==32570== by 0x418F16: ped_disk_commit_to_dev (disk.c:486)
==32570== by 0x418F5C: ped_disk_commit (disk.c:509)
==32570== by 0x40BAD6: do_mkpartfs (parted.c:981)
==32570== by 0x40A035: command_run (command.c:139)
==32570== by 0x412150: non_interactive_mode (ui.c:1540)
==32570== by 0x40EE83: main (parted.c:2487)
reproduce with this:
dev=f
dd if=/dev/null of=$dev bs=1 seek=30M 2>/dev/null
./parted -s $dev mklabel gpt
valgrind ./parted -s $dev mkpartfs primary ext2 0
16795000B