+2009-05-24 Alan Modra <amodra@bigpond.net.au>
+
+ * bfdio.c (bfd_seek): Formatting. Ensure newly allocated memory
+ for BFD_IN_MEMORY is cleared.
+ (bfd_bwrite): Zero excess memory allocated.
+
2009-05-22 Julian Brown <julian@codesourcery.com>
* elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New
bim->size = 0;
return 0;
}
+ if (newsize > bim->size)
+ memset (bim->buffer + bim->size, 0, newsize - bim->size);
}
}
memcpy (bim->buffer + abfd->where, ptr, (size_t) size);
if (abfd->where > bim->size)
{
- if ((abfd->direction == write_direction) ||
- (abfd->direction == both_direction))
+ if (abfd->direction == write_direction
+ || abfd->direction == both_direction)
{
bfd_size_type newsize, oldsize;
bim->size = 0;
return -1;
}
+ memset (bim->buffer + oldsize, 0, newsize - oldsize);
}
}
else