fix memory corruption from jedec code (Jon Smirl)

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1464 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent 3023f02171
commit 4349404e81

@ -1,3 +1,7 @@
2009-03-27 Arnim Laeuger <arniml>
* src/flash/jedec.c: fix memory corruption from jedec code (Jon Smirl)
2009-03-26 Arnim Laeuger <arniml>
* src/cmd/initbus.c: Notify which bus is active when a new bus is initialized

@ -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 */

Loading…
Cancel
Save