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

[confmap] Return error when decoding negative values into uints #9169

Merged
merged 11 commits into from
Apr 19, 2024

Conversation

crobert-1
Copy link
Member

Description:
This adds a decode hook for unmarshalling negative integers into uint types. This will now return an error instead of converting negative values into large uint values.

Link to tracking Issue:
Fixes #9060

Testing:
Added unit tests for confmap functionality, functional tests in memory limiter processor (the original component this issue was filed against)

@crobert-1 crobert-1 requested review from a team and bogdandrutu December 21, 2023 17:01
confmap/confmap.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.77%. Comparing base (05ceb20) to head (54a3d4d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9169   +/-   ##
=======================================
  Coverage   91.77%   91.77%           
=======================================
  Files         359      359           
  Lines       16631    16637    +6     
=======================================
+ Hits        15263    15269    +6     
  Misses       1041     1041           
  Partials      327      327           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@crobert-1 crobert-1 force-pushed the fix_negative_uint_config branch from 2ea573e to d8707cc Compare December 22, 2023 00:08
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 17, 2024
@crobert-1 crobert-1 force-pushed the fix_negative_uint_config branch from d8707cc to a531fc7 Compare January 17, 2024 16:46
@github-actions github-actions bot removed the Stale label Jan 18, 2024
Copy link
Contributor

github-actions bot commented Feb 3, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 3, 2024
@crobert-1 crobert-1 force-pushed the fix_negative_uint_config branch from 661dc8b to be15997 Compare February 5, 2024 16:58
@github-actions github-actions bot removed the Stale label Feb 7, 2024
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Feb 28, 2024
@crobert-1
Copy link
Member Author

I believe this is ready to be merged.

@bogdandrutu Do you have any concerns here?

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Mar 22, 2024
This adds a decode hook for unmarshalling negative integers into
uint types. This will now return an error instead of converting
negative values into large uint values.
- Add test case for uint64(-1000) conversion
- Clean existing test case
@crobert-1 crobert-1 force-pushed the fix_negative_uint_config branch from 33771c1 to de96bcb Compare March 22, 2024 17:47
@github-actions github-actions bot removed the Stale label Mar 26, 2024
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

This comes from #9532. Can we add a note to remove the hook once we disable WeaklyTypedInput?

@crobert-1
Copy link
Member Author

This comes from #9532. Can we add a note to remove the hook once we disable WeaklyTypedInput?

Done. I've added a TODO referencing the issue. 👍

@mx-psi mx-psi merged commit 4a58092 into open-telemetry:main Apr 19, 2024
49 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 19, 2024
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.

[processor/memory_limiter] Negative limit values are not rejected
6 participants