Commit 3caddc1
Ticket #5084: fix integer overflow in binary CPIO handler
Add a bounds check on st_size immediately after it is computed, before it is
used in any arithmetic or allocation. A reasonable upper bound for a symlink
target is MC_MAXPATHLEN (4096).
Signed-off-by: Michał Majchrowicz <sectroyer@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>1 parent b6012a2 commit 3caddc1
1 file changed
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
522 | 524 | | |
523 | 525 | | |
524 | 526 | | |
| |||
597 | 599 | | |
598 | 600 | | |
599 | 601 | | |
600 | | - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
601 | 608 | | |
602 | 609 | | |
603 | 610 | | |
| |||
751 | 758 | | |
752 | 759 | | |
753 | 760 | | |
754 | | - | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
755 | 767 | | |
756 | 768 | | |
757 | 769 | | |
| |||
0 commit comments