Add PyExc_OverflowError to the list of possible exceptions in fuzz_ast_literal_eval fuzzer - #145429
Conversation
ammaraskar
left a comment
There was a problem hiding this comment.
Looks good to ignore this, we don't particularly care about overflow here.
…_ast_literal_eval` fuzzer (pythonGH-145429)
|
Let's backport this? Failing CIFuzz doesn't block merge but is often distracting, for example #158015 on 3.13. |
|
Thanks @StanFromIreland for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @StanFromIreland for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
Thanks @StanFromIreland for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
This comment was marked as outdated.
This comment was marked as outdated.
|
GH-158083 is a backport of this pull request to the 3.13 branch. |
|
GH-158084 is a backport of this pull request to the 3.14 branch. |
|
Personally, I'd rather remove them from the CI on those branches entirely, but this is fine in the meantime. |
This fixes the "bug" found in https://oss-fuzz.com/testcase-detail/5450638250278912.
>>> import ast ... data = open('/tmp/testcase', 'rb').read() ... ast.literal_eval(data[:data.index(0)].decode()) ... <python-input-2>:2: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/testcase'> ResourceWarning: Enable tracemalloc to get the object allocation traceback Traceback (most recent call last): File "<python-input-2>", line 3, in <module> ast.literal_eval(data[:data.index(0)].decode()) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/stan/dev/cpython/Lib/ast.py", line 64, in literal_eval return _convert_literal(node_or_string) File "/home/stan/dev/cpython/Lib/ast.py", line 108, in _convert_literal return left + right ~~~~~^~~~~~~ OverflowError: int too large to convert to floatWith fuzzer
Currently:
With fix: