util: Fix out of bounds memory access

The change also fixes numeric values output produced by fdtdump.

Signed-off-by: Serge Lamikhov-Center <Serge.Lamikhov@gmail.com>
This commit is contained in:
Serge Lamikhov-Center 2013-09-30 11:04:26 +03:00 committed by David Gibson
parent b290428d71
commit 883238dc50

2
util.c
View file

@ -376,7 +376,7 @@ void utilfdt_print_data(const char *data, int len)
printf(" = <"); printf(" = <");
for (i = 0; i < len; i += 4) for (i = 0; i < len; i += 4)
printf("0x%08x%s", fdt32_to_cpu(cell[i]), printf("0x%08x%s", fdt32_to_cpu(cell[i / 4]),
i < (len - 4) ? " " : ""); i < (len - 4) ? " " : "");
printf(">"); printf(">");
} else { } else {