8000 gh-95778: Add pre-check for int-to-str conversion by mdickinson · Pull Request #96537 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-95778: Add pre-check for int-to-str conversion #96537

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

Merged
merged 14 commits into from
Sep 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor comment typo fix (restart CI).
  • Loading branch information
gpshead committed Sep 4, 2022
commit 56f08c28c33bfa035ccb1b76599b262b6150cc0e
4 changes: 2 additions & 2 deletions Lib/test/test_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def test_denial_of_service_prevented_int_to_str(self):
maxdigits = sys.get_int_max_str_digits()
assert maxdigits < 50_000, maxdigits # A test prerequisite.
get_time = time.process_time
if get_time() <= 0: # some platforms like WASM lacks process_time()
if get_time() <= 0: # some platforms like WASM lack process_time()
get_time = time.monotonic

huge_int = int(f'0x{"c"*65_000}', base=16) # 78268 decimal digits.
Expand Down Expand Up @@ -682,7 +682,7 @@ def test_denial_of_service_prevented_str_to_int(self):
maxdigits = sys.get_int_max_str_digits()
assert maxdigits < 100_000, maxdigits # A test prerequisite.
get_time = time.process_time
if get_time() <= 0: # some platforms like WASM lacks process_time()
if get_time() <= 0: # some platforms like WASM lack process_time()
get_time = time.monotonic

huge = '8'*200_000
Expand Down
0