Skip to content

ConfigUtilities.ParseTimeSpan overflows too easily: use double instead of int - #4

Merged
gabikliot merged 1 commit into
dotnet:masterfrom
ReubenBond:master
Jan 23, 2015
Merged

ConfigUtilities.ParseTimeSpan overflows too easily: use double instead of int#4
gabikliot merged 1 commit into
dotnet:masterfrom
ReubenBond:master

Conversation

@ReubenBond

Copy link
Copy Markdown
Member

Currently, ConfigUtilities.ParseTimeSpan parses values into a string before multiplying them into milliseconds and passing them into TimeSpan.FromMilliseconds, which expects a double.

Multiplying the parsed value into milliseconds can cause it to overflow, resulting in a negative TimeSpan.

By parsing directly into double, these overflows can be largely avoided.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants