-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-142831: Fix UAF in _json module
#142851
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
base: main
Are you sure you want to change the base?
Conversation
serhiy-storchaka
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.
Could you add tests?
|
Added tests |
|
I pushed a minor test change to make the test run on both pure python and C encoder. |
|
@kumaraditya303 But the new tests don't reproduce the issue! |
This reverts commit 66c3af1.
I was able to reproduce it but now I can't, not sure if it was a build cache issue or something. Sorry reverted it back. |
| def __init__(self): | ||
| super().__init__(real=1) |
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.
I think this is not needed, you can just pass arguments to the BadDict constructor at line 97.
| if c_make_encoder is None: | ||
| self.skipTest("c_make_encoder not available") |
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.
Would not be better to move the test to test_speedups.py?
json.encodermapping iteration via re-entrant key encoder #142831