We defined WORDS_BIGENDIAN to 0 if it wasn't defined, however that doesn't work with Apple universal
builds, since we don't know the endianness at configure time!
So add the ifndef WORDS_BIGNENDIAN -> define WORDS_BIGENDIAN 0 logic to
platform.h.
RedHat's version (3.4.6 20060404 (Red Hat 3.4.6-11) is buggy, see http://farm.0xacab.net/build/show/6292
FreeBSD's version appears to work, they can pass --enable-llvm, and if make
check passes use it.
fd == 0 is used to mark an invalid fd (not fd -1).
Test that tempfile is not NULL before calling cli_unlink
(that is the cause of the Bad address errors).
Also call cli_unlink when a virus is found. This isn't strictly
necessary since the file will get removed by the parent's rmdirs(),
but there is no point in leaving it behind.
All bytecode functions are loaded in a single module, the bounds verifier is
run, and then stack protectors are inserted.
The problem is that when the next bytecode function is loaded, all functions get
run through the verifier again (including those which got the stack protector
applied), and the bounds verifier rejects it (it doesn't know about stack
protectors).
The fix is to skip running the bounds verifier when a function already has the
stack protector applied, when run in libclamav.
This affects only loading of multiple unsigned bytecodes, or an unsigned
bytecode + bytecode.cvd.
Load of a single unsigned bytecode works, and load of multiple signed bytecodes
is not affected (since the verifier is skipped there).
Solaris has 2 greps, one archaic that doesn't know -E and -F,
and one that does. Configure finds the correct one, but
'make check' was using the wrong one.
This patch makes 'lit' substitute 'grep ' with the path to the
correct grep.