Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
xishir opened this issue Apr 7, 2023 · 5 comments · Fixed by #23
Closed

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

xishir opened this issue Apr 7, 2023 · 5 comments · Fixed by #23
Labels
bug Something isn't working

Comments

@xishir
Copy link

xishir commented Apr 7, 2023

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

@zema1 zema1 added the bug Something isn't working label Apr 7, 2023
@imemaker
Copy link

imemaker commented Apr 7, 2023

i have the same problem too!!!

@sairson
Copy link

sairson commented Apr 8, 2023

image
同样的问题

@imemaker
Copy link

imemaker commented Apr 8, 2023

@zema1

@astring0
Copy link

astring0 commented Apr 8, 2023

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

@Ghr07h
Copy link

Ghr07h commented Apr 8, 2023

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

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

zema1 added a commit that referenced this issue Apr 10, 2023
zema1 added a commit that referenced this issue Apr 10, 2023
zema1 added a commit that referenced this issue Apr 10, 2023
@zema1 zema1 closed this as completed in #23 Apr 10, 2023
zema1 added a commit that referenced this issue Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants