Skip to content

Commit

Permalink
reporter.go 未检查造成的越界
Browse files Browse the repository at this point in the history
  • Loading branch information
tsosunchia committed Nov 23, 2023
1 parent 9a3f250 commit 36507ad
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions reporter/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ func (r *reporter) InitialBaseData() Reporter {
r.targetTTL = uint16(len(r.routeResult.Hops))

for i := uint16(0); i < r.targetTTL; i++ {
traceHop := r.routeResult.Hops[i][0]
if traceHop.Success {
currentIP := traceHop.Address.String()
r.wg.Add(1)
go r.generateRouteReportNode(currentIP, *traceHop.Geo, i)
if i < uint16(len(r.routeResult.Hops)) && len(r.routeResult.Hops[i]) > 0 {
traceHop := r.routeResult.Hops[i][0]
if traceHop.Success {
currentIP := traceHop.Address.String()
r.wg.Add(1)
go r.generateRouteReportNode(currentIP, *traceHop.Geo, i)
}
}
}

Expand Down

0 comments on commit 36507ad

Please sign in to comment.