Commit fa6d8d0
committed
[3.12] pythongh-119342: Fix a potential denial of service in plistlib (pythonGH-119343)
Reading a specially prepared small Plist file could cause OOM because file's
read(n) preallocates a bytes object for reading the specified amount of
data. Now plistlib reads large data by chunks, therefore the upper limit of
consumed memory is proportional to the size of the input file.
(cherry picked from commit 694922c)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>1 parent a183a11 commit fa6d8d0
File tree
3 files changed
+59
-14
lines changed- Lib
- test
- Misc/NEWS.d/next/Security
3 files changed
+59
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
499 | 502 | | |
500 | 503 | | |
501 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
502 | 517 | | |
503 | | - | |
| 518 | + | |
504 | 519 | | |
505 | 520 | | |
506 | 521 | | |
507 | | - | |
| 522 | + | |
508 | 523 | | |
509 | 524 | | |
510 | 525 | | |
| |||
561 | 576 | | |
562 | 577 | | |
563 | 578 | | |
564 | | - | |
565 | | - | |
566 | | - | |
| 579 | + | |
567 | 580 | | |
568 | 581 | | |
569 | 582 | | |
570 | | - | |
571 | | - | |
572 | | - | |
| 583 | + | |
573 | 584 | | |
574 | 585 | | |
575 | 586 | | |
576 | 587 | | |
577 | | - | |
578 | | - | |
579 | | - | |
| 588 | + | |
580 | 589 | | |
581 | 590 | | |
582 | 591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
844 | | - | |
845 | | - | |
| 844 | + | |
846 | 845 | | |
847 | 846 | | |
848 | 847 | | |
| |||
854 | 853 | | |
855 | 854 | | |
856 | 855 | | |
857 | | - | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
858 | 861 | | |
859 | 862 | | |
860 | 863 | | |
| |||
963 | 966 | | |
964 | 967 | | |
965 | 968 | | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
966 | 997 | | |
967 | 998 | | |
968 | 999 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments