Commit 6969658
committed
gh-119342: Fix OOM vulnerability in plistlib
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.1 parent e870c85 commit 6969658
File tree
3 files changed
+60
-14
lines changed- Lib
- test
- Misc/NEWS.d/next/Security
3 files changed
+60
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
511 | 528 | | |
512 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
513 | 532 | | |
514 | 533 | | |
515 | 534 | | |
516 | | - | |
| 535 | + | |
517 | 536 | | |
518 | 537 | | |
519 | 538 | | |
| |||
573 | 592 | | |
574 | 593 | | |
575 | 594 | | |
576 | | - | |
577 | | - | |
578 | | - | |
| 595 | + | |
579 | 596 | | |
580 | 597 | | |
581 | 598 | | |
582 | | - | |
583 | | - | |
584 | | - | |
| 599 | + | |
585 | 600 | | |
586 | 601 | | |
587 | 602 | | |
588 | 603 | | |
589 | | - | |
590 | | - | |
591 | | - | |
| 604 | + | |
592 | 605 | | |
593 | 606 | | |
594 | 607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
907 | | - | |
908 | | - | |
| 907 | + | |
909 | 908 | | |
910 | 909 | | |
911 | 910 | | |
| |||
917 | 916 | | |
918 | 917 | | |
919 | 918 | | |
920 | | - | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
921 | 924 | | |
922 | 925 | | |
923 | 926 | | |
| |||
1025 | 1028 | | |
1026 | 1029 | | |
1027 | 1030 | | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1028 | 1059 | | |
1029 | 1060 | | |
1030 | 1061 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments