-
Notifications
You must be signed in to change notification settings - Fork 713
fix: Return modified labels after validation sanitization #4662
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
Conversation
This fixes a bug where the logic in `handleSanitizedLabel` was not properly executed. The code would modify the slice itself, but this new modified slice was never returned up the call stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU, the modified length wasn't being propagated back to the callers, was it?
LGTM
|
cc @simonswine you might want to take a look as well. |
Yes exactly, here: pyroscope/pkg/validation/validate.go Lines 207 to 228 in 2e303da
|
simonswine
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for catching and fixing this, it is amazing how many bugs we have found in this piece of code.
I think ew can merge this as is, but probably we should rename ValidateLabels to SanitizeLabels, as its name doesn't suggest, it is a mutation operation.
|
It will soon be just validation since the sanitization logic will be removed with the utf8 label name work |
This fixes a bug where the logic in
handleSanitizedLabelwas not properly executed. The code would modify the slice itself, but this new modified slice was never returned up the call stack.