u-boot/disk
Marek Vasut 67cd4a6348 disk: Fix possible out-of-bounds access in part_efi.c
Make sure to never access beyond bounds of either EFI partition name
or DOS partition name. This situation is happening:

part.h:     disk_partition_t->name is 32-byte long
part_efi.h: gpt_entry->partition_name is 36-bytes long

The loop in part_efi.c copies over 36 bytes and thus accesses beyond
the disk_partition_t->name .

Fix this by picking the shortest of source and destination arrays and
make sure the destination array is cleared so the trailing bytes are
zeroed-out and don't cause issues with string manipulation.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
2013-06-04 16:06:32 -04:00
..
Makefile disk/part.c: Make features optional 2011-07-26 14:10:14 +02:00
part_amiga.c disk: define HAVE_BLOCK_DEVICE in a common place 2013-03-14 11:06:44 -07:00
part_amiga.h * Code cleanup: 2003-06-27 21:31:46 +00:00
part_dos.c disk/part_dos: check harder for partition table 2013-05-01 16:24:01 -04:00
part_dos.h disk: part_msdos: parse and store partition UUID 2012-09-25 15:05:45 -07:00
part_efi.c disk: Fix possible out-of-bounds access in part_efi.c 2013-06-04 16:06:32 -04:00
part_iso.c disk/iso: Add Support for block sizes > 512 byte to ISO partition support 2013-05-01 16:24:02 -04:00
part_iso.h Big white-space cleanup. 2008-05-21 00:14:08 +02:00
part_mac.c disk: define HAVE_BLOCK_DEVICE in a common place 2013-03-14 11:06:44 -07:00
part_mac.h * Code cleanup: 2003-06-27 21:31:46 +00:00
part.c disk: define HAVE_BLOCK_DEVICE in a common place 2013-03-14 11:06:44 -07:00