zema1 / watchvuln

一个高价值漏洞采集与推送服务 | collect valueable vulnerability and push it
MIT License
1.37k stars 151 forks source link

grab/ti.go:53 panic问题 #21

Closed xishir closed 1 year ago

xishir commented 1 year ago

panic: runtime error: integer divide by zero

goroutine 72 [running]: github.com/zema1/watchvuln/grab.(TiCrawler).GetPageCount(0xc00038ee80, {0x110ae38?, 0xc0002d3f80}, 0x64) github.com/zema1/watchvuln/grab/ti.go:53 +0x3be main.initData({0x110ae38, 0xc0002d3f80}, 0xc0002d3780, {0x110b848, 0xc00038ee80}) github.com/zema1/watchvuln/main.go:386 +0xd5 main.Action.func1() github.com/zema1/watchvuln/main.go:188 +0x2d golang.org/x/sync/errgroup.(Group).Go.func1() golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 created by golang.org/x/sync/errgroup.(*Group).Go golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

imemaker commented 1 year ago

i have the same problem too!!!

sairson commented 1 year ago

image 同样的问题

imemaker commented 1 year ago

@zema1

astring0 commented 1 year ago

奇安信ti的接口一个ip速度请求过快的话,服务端会返回一个空表

Ghr07h commented 1 year ago

而53行没有考虑过pageCount为空的情况,可以把pageCount提前判断一下不为零即可向下运行,不过还是要达到预期效果还是要控制一下访问间隔的

# Line 53
if pageCount != 0 && total%pageCount != 0