On Thu, Nov 28, 2019 at 10:30:22AM +0100, Baptiste wrote: > I am personally all confused by this report :) > Furthermore, as mentioned the test on eb was already done. > If the fix is to remove the useless test on res, then William's patch is > right.
Here coverity assumes that if eb is not 0, it cannot be 60 either because that's still in within the NULL page. But such tests could easily be fooled. For example we could have functions returning composite error codes between 0 and 4095 in a pointer or a valid pointer (a bit a-la mmap() except that this one returns -1 to -4096). At least it managed to spot really dead code :-) And indeed, in the context appearing in the github report I didn't see that eb was already tested above. Thanks for the report and the fix! Willy