Commit aea56f4
committed
listdir(): reuse a single buffer to store every file name to display
Allocating a new buffer for each entry is useless.
And as these buffers are allocated on the stack, on systems with a
small stack size, with many entries, the limit can easily be reached,
causing a stack exhaustion and aborting the user session.
Reported by Antonio Morales from the GitHub Security Lab team, thanks!1 parent 75ae1c9 commit aea56f4
1 file changed
+8
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| 664 | + | |
| 665 | + | |
664 | 666 | | |
665 | 667 | | |
666 | 668 | | |
| |||
690 | 692 | | |
691 | 693 | | |
692 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
693 | 699 | | |
694 | 700 | | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
| 709 | + | |
709 | 710 | | |
710 | | - | |
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
| |||
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
| 723 | + | |
723 | 724 | | |
724 | 725 | | |
725 | 726 | | |
| |||
0 commit comments