gh-101178: Fix UB in `binascii.b2a_ascii85` by StanFromIreland · Pull Request #148166 · python/cpython
-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Conversation
Spotted when running the test:
$ ./python -m test test_binascii
Using random seed: 2254522381
0:00:00 load avg: 0.43 Run 1 test sequentially in a single process
0:00:00 load avg: 0.43 [1/1] test_binascii
Modules/binascii.c:1243:42: runtime error: left shift of 129 by 24 places cannot be represented in type 'int'
Modules/binascii.c:1484:42: runtime error: left shift of 130 by 24 places cannot be represented in type 'int'
0:00:00 load avg: 0.43 [1/1] test_binascii passed
== Tests result: SUCCESS ==
1 test OK.
Total duration: 89 ms
Total tests: run=197 skipped=17
Total test files: run=1/1
Result: SUCCESS
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. LGTM. 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters