vt-go
vt-go copied to clipboard
errNoAvailableYet wait mechanism doesn't work(got panic)
Hello.
In my knowledge, errNoAvailableYet occur when the the time of the current package is large than (T-59m).
This will definitely happen because the seed generation time is 1 minute, but the polling time is 20s.
When the time occurs, code should wait for the seed to be generated, but the program will panic directly.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xee9164]
goroutine 117 [running]:
github.com/VirusTotal/vt-go.(*Feed).getObjects(0xc000410e00, 0xc013b3ce70, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0)
/root/go/pkg/mod/github.com/!virus!total/[email protected]/feed.go:189 +0x684
github.com/VirusTotal/vt-go.(*Feed).retrieve(0xc000410e00)
/root/go/pkg/mod/github.com/!virus!total/[email protected]/feed.go:227 +0xaa
created by github.com/VirusTotal/vt-go.(*Client).NewFeed
/root/go/pkg/mod/github.com/!virus!total/[email protected]/feed.go:126 +0x22a
I analyzed this problem, bug arises from the error return of parseResponse.
This 400 resp'Content-Type is application/json
,but the error used gzip, and then returned a nil Response.
use any time of the current package which large than (T-59m) can reproduce this problem