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

Possible flaw in TokenFilterContext#skipParentChecks() #898

Closed
robotmrv opened this issue Jan 26, 2023 · 2 comments
Closed

Possible flaw in TokenFilterContext#skipParentChecks() #898

robotmrv opened this issue Jan 26, 2023 · 2 comments
Milestone

Comments

@robotmrv
Copy link

There is a code in com.fasterxml.jackson.core.filter.TokenFilterContext#skipParentChecks

public void skipParentChecks() {
    _filter = null;
    for (TokenFilterContext ctxt = _parent; ctxt != null; ctxt = ctxt._parent) {
        _parent._filter = null;
    }
}

since _parent is a field looks like there is typo in the loop body
_parent._filter = null; -> ctxt._filter = null;

This is actual for at least 2.13, 2.14, 2.15 branches

@cowtowncoder
Copy link
Member

Yes @robotmrv this does look like a flaw. Thank you for reporting this!

Let me see what happens if I try fix -- I am bit hesitant to make change in a patch so probably needs to in 2.15(.0).
This although method appears to be used for optimization and should not change behavior.

@cowtowncoder cowtowncoder changed the title Possible typo in com.fasterxml.jackson.core.filter.TokenFilterContext#skipParentChecks Possible flaw in TokenFilterContext#skipParentChecks() Jan 28, 2023
@cowtowncoder cowtowncoder added this to the 2.15.0 milestone Jan 28, 2023
@cowtowncoder
Copy link
Member

Ok no test failures; seems safe enough so merged fix in, to be included in 2.15.0.
(too bad there's no unit test for this but... if there was, but wouldn't have been)

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

No branches or pull requests

2 participants