Repository navigation
Commit 2aef2ba
committed
gh-162375: Enforce format width and precision limits in _pydecimal
Enforce MAX_PREC limits on minimumwidth and precision in _pydecimal._parse_format_specifier() to match _decimal and prevent unbounded CPU and memory usage on excessive specifiers.
Also optimize _pydecimal._insert_thousands_sep() when thousands_sep is empty by padding directly in one step rather than looping in groups of 3.1 parent 91c4c6b commit 2aef2ba
3 files changed
Lines changed: 26 additions & 0 deletions
File tree
- Lib
- test
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6323 | 6323 | | |
6324 | 6324 | | |
6325 | 6325 | | |
| 6326 | + | |
| 6327 | + | |
6326 | 6328 | | |
6327 | 6329 | | |
| 6330 | + | |
| 6331 | + | |
6328 | 6332 | | |
6329 | 6333 | | |
6330 | 6334 | | |
| |||
6424 | 6428 | | |
6425 | 6429 | | |
6426 | 6430 | | |
| 6431 | + | |
| 6432 | + | |
| 6433 | + | |
| 6434 | + | |
| 6435 | + | |
| 6436 | + | |
6427 | 6437 | | |
6428 | 6438 | | |
6429 | 6439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1326 | 1326 | | |
1327 | 1327 | | |
1328 | 1328 | | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1329 | 1343 | | |
1330 | 1344 | | |
1331 | 1345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments