Commit f2e32f0
authored
file_path: avoid fortified realpath() buffer size abort (#19037)
glibc's fortified realpath() checks that the destination buffer is at
least PATH_MAX bytes. path_resolve_realpath() was passing the caller's
buffer directly, which may be smaller than the system PATH_MAX despite
being sized to RetroArch's PATH_MAX_LENGTH.
With _FORTIFY_SOURCE=3 this can abort in __realpath_chk when resolving
core updater paths.
Resolve into an allocated realpath() buffer instead, then copy the result
back into the caller-provided buffer using the provided length.1 parent 6b6e4d3 commit f2e32f0
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
| 796 | + | |
796 | 797 | | |
797 | | - | |
| 798 | + | |
| 799 | + | |
798 | 800 | | |
799 | 801 | | |
800 | 802 | | |
801 | 803 | | |
| 804 | + | |
| 805 | + | |
802 | 806 | | |
803 | 807 | | |
804 | 808 | | |
| |||
0 commit comments