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

internal/log: fix potential integer conversion issue from parsed value #2289

Merged
merged 5 commits into from
Oct 25, 2023

Conversation

darccio
Copy link
Member

@darccio darccio commented Oct 24, 2023

What does this PR do?

Parses DD_LOGGING_RATE as int64 instead of uint64 to make sure, although it should contain a big value to happen, it doesn't yield unexpected results when converted to time.Duration.

Respects the current behaviour by taking into account that a zero value means to log immediately.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@darccio darccio requested a review from a team as a code owner October 24, 2023 14:35
@darccio darccio changed the title Dario.castane/vuln 4830/fix integer types conversion internal/log: fix potential integer conversion issue from parsed value Oct 24, 2023
internal/log/log.go Outdated Show resolved Hide resolved
internal/log/log.go Show resolved Hide resolved
internal/log/log_test.go Outdated Show resolved Hide resolved
@pr-commenter
Copy link

pr-commenter bot commented Oct 24, 2023

Benchmarks

Benchmark execution time: 2023-10-24 15:07:02

Comparing candidate commit 6a44811 in PR branch dario.castane/VULN-4830/fix-integer-types-conversion with baseline commit 5e9b0b1 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 40 metrics, 1 unstable metrics.

@darccio darccio merged commit 5f985bb into main Oct 25, 2023
52 checks passed
@darccio darccio deleted the dario.castane/VULN-4830/fix-integer-types-conversion branch October 25, 2023 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants