outguess icon indicating copy to clipboard operation
outguess copied to clipboard

Floating point exception in iterator.c in 0.2.1

Open neuroretransmit opened this issue 4 years ago • 0 comments

Invalid data and various images have thrown signal 8 (floating point exception) when attempting to retrieve stegged data. Integer division by 0 is occurring.

Example file to cause crash: 0

$ valgrind ./outguess -r ../0.2.1/0.jpg 0.jpg.msg
==1195417== Memcheck, a memory error detector
==1195417== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1195417== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==1195417== Command: ./outguess -r ../0.2.1/0.jpg 0.jpg.msg
==1195417== 
Reading ../0.2.1/0.jpg....
Corrupt JPEG data: bad Huffman code
Extracting usable bits:   20547 bits
Steg retrieve: seed: 63685, len: 1918
==1195417== 
==1195417== Process terminating with default action of signal 8 (SIGFPE)
==1195417==  Integer divide by zero at address 0x1002E01FA8
==1195417==    at 0x1115FF: iterator_next (iterator.c:56)
==1195417==    by 0x10C024: steg_retrbyte (outguess.c:344)
==1195417==    by 0x10DC8F: steg_retrieve (outguess.c:400)
==1195417==    by 0x10AD5E: main (outguess.c:1100)
==1195417== 
==1195417== HEAP SUMMARY:
==1195417==     in use at exit: 25,974,178 bytes in 10 blocks
==1195417==   total heap usage: 56 allocs, 46 frees, 26,238,474 bytes allocated
==1195417== 
==1195417== LEAK SUMMARY:
==1195417==    definitely lost: 0 bytes in 0 blocks
==1195417==    indirectly lost: 0 bytes in 0 blocks
==1195417==      possibly lost: 0 bytes in 0 blocks
==1195417==    still reachable: 25,974,178 bytes in 10 blocks
==1195417==         suppressed: 0 bytes in 0 blocks
==1195417== Rerun with --leak-check=full to see details of leaked memory
==1195417== 
==1195417== For lists of detected and suppressed errors, rerun with: -s
==1195417== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Floating point exception

neuroretransmit avatar Aug 25 '21 16:08 neuroretransmit