On 8/29/07, Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net wrote:
for (walk = archive->start;
(walk - 1) < (char *)(archive->start + archive->len - 1 ); walk += 16) {
(walk <= (char *)(archive->start + archive->len - sizeof(struct lar_header))) &&
(walk >= (char *)archive->start); walk += 16) {
instead? Looking for a lar header 1 byte before the end of the archive is not going to succeed anyway.
works for me.
Should we additionally check at the beginning of the function that the archive is at least as long as sizeof(struct lar_header)?
Ah, well, we can do that, but ... what are we going to do at that point? I'll put the check in with a warning, in case there is bogus cruft, but I don't think we can give up at that point.
thanks
ron