diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 2be5d7a9..179c4f7b 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,7 @@ +2009-03-27 Arnim Laeuger + + * src/flash/jedec.c: fix memory corruption from jedec code (Jon Smirl) + 2009-03-26 Arnim Laeuger * src/cmd/initbus.c: Notify which bus is active when a new bus is initialized diff --git a/jtag/src/flash/jedec.c b/jtag/src/flash/jedec.c index 3c687c52..ce526a2c 100644 --- a/jtag/src/flash/jedec.c +++ b/jtag/src/flash/jedec.c @@ -391,7 +391,7 @@ jedec_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array ) return -3; /* invalid bus width */ (*cfi_array)->bus_width = ba = bw / 8; - (*cfi_array)->cfi_chips = calloc( 1, sizeof (cfi_chip_t *) ); + (*cfi_array)->cfi_chips = calloc( 1, sizeof (cfi_chip_t *) * ba); if (!(*cfi_array)->cfi_chips) return -2; /* out of memory */