jessek / hashdeep

Other
694 stars 130 forks source link

Crash using -e option in audit mode #365

Open biniand opened 7 years ago

biniand commented 7 years ago

Hi, I'm using version 4.4 on Ubuntu GNOME 16.04 amd64 from a bash shell.

$ hashdeep -V
4.4
$ uname -ap
Linux andrea-desktop 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

After creating a checksum file, trying the audit mode, I've forgotten to specify the files to be checked. When I realized that it was reading from stdin, I've sent an EOF with C-d, expecting to see an audit failed message, but the program crashed with SIGFPE. The issue is probably related to the -e option, as you can see in the following examples.

$ hashdeep -c sha256 *.jpg > SHA256SUMS
$ hashdeep -k SHA256SUMS -a -e
Floating point exception (core dumped)
$ hashdeep -k SHA256SUMS -a
hashdeep: Audit failed
$ hashdeep -k SHA256SUMS -a -b
hashdeep: Audit failed

Thank you!