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

x/net: net/internal/timeseries/timeseries.go - Division by zero #57466

Closed
stasos24 opened this issue Dec 26, 2022 · 3 comments
Closed

x/net: net/internal/timeseries/timeseries.go - Division by zero #57466

stasos24 opened this issue Dec 26, 2022 · 3 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@stasos24
Copy link

stasos24 commented Dec 26, 2022

What do you expect to see

https://github.com/golang/net/blob/2aa82152a53e7aa6b28c6390d9369ee5a5b63584/internal/timeseries/timeseries.go#L360

if num <=0

What did you see instead?

When ComputeRange(start, finish time.Time, num int) function
https://github.com/golang/net/blob/2aa82152a53e7aa6b28c6390d9369ee5a5b63584/internal/timeseries/timeseries.go#L354
is called with num=0 you'll get Division by zero at
https://github.com/golang/net/blob/2aa82152a53e7aa6b28c6390d9369ee5a5b63584/internal/timeseries/timeseries.go#L398

@gopherbot gopherbot added this to the Unreleased milestone Dec 26, 2022
@seankhliao
Copy link
Member

does this actually come up in real code?

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 26, 2022
@stasos24
Copy link
Author

No, but if someone is calling this function where num is dynamically assigned, there's possible division by zero

@seankhliao
Copy link
Member

given this is internal code with no direct path for misuse, i don't think this is an issue.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2022
@golang golang locked and limited conversation to collaborators Dec 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants
@gopherbot @seankhliao @stasos24 and others