-
Notifications
You must be signed in to change notification settings - Fork 5k
[libbeat] Do not modify slice while iterating over it #41520
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 pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
|
rdner
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.
The change looks good to me but we should address all linter issues before merging.
* [libbeat] Do not modify slice while iterating over it * fix linting * fix regex test case failing (cherry picked from commit fde942b)
* [libbeat] Do not modify slice while iterating over it * fix linting * fix regex test case failing (cherry picked from commit fde942b) Co-authored-by: Khushi Jain <[email protected]>
Proposed commit message
We were modifying
config.Fieldswhile iterating over it (indrop_fieldsprocessor) - which can lead to unexpected behavior, such as skipping elements or accessing out-of-bounds indices.This PR now makes sure not to drop mandatory fields.
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Does this require changelog entry?