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

ConfigItem: Fix infinite recursion caused by ignore_on_error #9560

Merged
merged 2 commits into from
Nov 2, 2022

Conversation

yhabteab
Copy link
Member

Backport of #9406

…ommitting an item

When committing an item with `ignore_on_error` flag set fails, the `Commit()` method only returns `nullptr`
and the current item is not being dropped from `m_Items`. `CommittNewItems()` also doesn't check the return
value of `Commit()` but just continues and tries to commit all items from `m_Items` in recursive call. Since
this corrupt item is never removed from `m_Items`, it ends up in an endless recursion till it finally crashes.
This also improves the performance a bit, as we longer have to iterate over the items
and copy them into the new items vector.
@cla-bot cla-bot bot added the cla/signed label Oct 31, 2022
@icinga-probot icinga-probot bot added this to the 2.13.6 milestone Oct 31, 2022
@yhabteab yhabteab added bug Something isn't working area/configuration DSL, parser, compiler, error handling labels Oct 31, 2022
@yhabteab yhabteab requested a review from julianbrost October 31, 2022 11:57
@yhabteab yhabteab changed the title Handle on error 213 Handle ignore_on_error flag properly Oct 31, 2022
@julianbrost julianbrost changed the title Handle ignore_on_error flag properly ConfigItem: Fix infinite recursion caused by ignore_on_error Oct 31, 2022
@julianbrost julianbrost enabled auto-merge October 31, 2022 14:04
@julianbrost julianbrost disabled auto-merge November 2, 2022 09:37
@julianbrost julianbrost merged commit 2f22be3 into support/2.13 Nov 2, 2022
@icinga-probot icinga-probot bot deleted the handle-on-error-213 branch November 2, 2022 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants