Fix memory corruption problems reported by glibc

git-svn-id: svn://coreboot.org/openbios/openbios-devel@139 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2007-05-05 10:03:56 +00:00
parent c4f3fbc099
commit c76de95466

View File

@@ -106,11 +106,11 @@ static void relocation_table(unsigned char * dict_one, unsigned char *dict_two,
int l=(length+(sizeof(cell)-1))/sizeof(ucell), i;
/* prepare relocation table */
relocation_length=(l+BITS-1)/BITS;
relocation_length=(length+BITS-1)/BITS;
reloc_table = malloc(relocation_length*sizeof(cell));
memset(reloc_table,0,relocation_length*sizeof(cell));
for (i=0; i<=l; i++) {
for (i=0; i<l; i++) {
pos=i/BITS;
bit=i&~(-BITS);