On Tue, May 5, 2009 at 12:58 AM, Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net wrote:
On 05.05.2009 06:55, ron minnich wrote:
There is actually no change to the find code in src/lib, in fact; that code also walks all of rom, in strides of 'align'.
Didn't we decide in v3 that walking all of ROM was a bad idea after that method (instead of skipping ahead based on headers) triggered too many false positives? Remember funny constructs like
/* I hope the compiler does not optimize this */ char *magic = "L" + "ARCHIVE"
What did I miss?
You didn't miss anything. It's a bug in the current cbfs walking code that I noticed last night.
Fix is simple: use Patrick's 'next' pointer or, when the code sees a valid file, it should skip to the end of that file and keep looking -- at which point it is likely to find another file or a non-magic value.
After this discussion I am thinking his next pointer is a good idea. ron