<div dir="ltr">Realistically, corrupt ELF files are rare enough that it's more likely<br>that we've actually found a bug in file(1), such as the .bss bug fixed<br>in the previous patch. That bug went undiscovered so long because we<br>silently give up on ELF files we don't understand, and the output didn't<br>look obviously broken even if you'd been told it was broken and were<br>looking at it.<br><br>Give up noisily instead so we find and fix any future bugs more quickly.<br><br>Also remove some duplicated code: the commit that switched to mmap(2)<br>rather than lseek(2) had two copies of the mmap call.<br>---<br> toys/posix/file.c | 51 +++++++++++++++++++++++++++++++----------------<br> 1 file changed, 34 insertions(+), 17 deletions(-)<br></div>