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

pkg/trace/traceutil: fix edge case in NormalizeTag #13235

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

ahmed-mez
Copy link
Contributor

@ahmed-mez ahmed-mez commented Aug 24, 2022

What does this PR do?

Fixes an edge case in NormalizeTag where the function can return tags longer than maxTagLength

Motivation

Bug fix

Additional Notes

Bug discovered thanks to fuzzing, the fuzz test will be introduced in #13195

--- FAIL: FuzzNormalizeTag (1.16s)
    --- FAIL: FuzzNormalizeTag (0.00s)
        fuzz_test.go:28: Max length (200) exceeded: runeCount(a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_00) == 201

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Tags normalization works as expected

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • If applicable, the config template has been updated.

@ahmed-mez ahmed-mez added this to the 7.40.0 milestone Aug 24, 2022
@ahmed-mez ahmed-mez marked this pull request as ready for review August 24, 2022 15:28
@ahmed-mez ahmed-mez requested a review from a team as a code owner August 24, 2022 15:28
Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find.

@knusbaum knusbaum merged commit 14e4823 into main Aug 24, 2022
@knusbaum knusbaum deleted the ahmed/fix-NormalizeTag branch August 24, 2022 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants