glaslos / ssdeep

SSDEEP hash lib in Golang
Other
100 stars 35 forks source link

Panic for "integer divide by zero" for empty file #1

Closed oneumyvakin closed 7 years ago

oneumyvakin commented 7 years ago

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
glaslos commented 7 years ago

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

glaslos commented 7 years ago

Fixed in 1e2b11fb27cbbc18aabcff4f0953058e5dea787f