I ran some fuzzying on dcraw and found a floating point exception.
What are the dangers of this? It reads some length plen
from the corrupted file and computes foo[i % plen]
. If plen == 0
then this is undefined by the standard and gcc throws a floating point exception. EDIT: And the exception is not caught (this is C) and the program terminates.
Should I care? Is there any scenario where this could be exploited or cause other bad things? One possible correct behaviour of the code would be to notice that the file is corrupted and just exist. How is that different than throwing a FPE and then exiting?
(I'm surprised that I haven't found a question on this because this seems very basic to me.)