glaslos/ssdeep

Panic for "integer divide by zero" for empty file

oneumyvakin opened this issue · 2 comments

STEPS

  1. Create empty file empty.txt.
  2. Try to execute following code:
deepSig := ssdeep.NewSSDEEP()
sigStr := deepSig.Fuzzy("empty.txt")

ACTUAL RESULT

panic: runtime error: integer divide by zero
goroutine 1 [running]:
github.com/glaslos/ssdeep.(*SSDEEP).Fuzzy(0xc042035e70, 0x4d68ce, 0xb, 0x0, 0x0)
	/GoPath/src/github.com/glaslos/ssdeep/ssdeep.go:137 +0x3f0

Hey, thanks for reporting those issues. Do you have time to look into them?

Fixed in 1e2b11f