Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During a case, We had some issues with endless recursion (and memory consumption) with some carved evtx files. It turned out that
read_open_start_element
tends to call itself with a fixed cursor position to try to read corrupt data. However, if the resulting position still contains invalid data, this leads to an infinite recursion.We tried to fix this by limiting the maximum recursion depth, but this did not solve the problem. In our case, we got an endless loop in Deserializer::inner_next, where cursor remained at one position and the byte after, and back again, and so on.
The current fix is to give the heuristics exactly one try, and if this fails, the reading of the token fails. In my eyes, no more tries should be done. In addition, we restore the original cursor position (before the heuristic call), which fixes the second problem.
With our test data, the fix is working well. Unfortunately, we cannot provide the data as test data, because they contain customer data.
Regards, Jan