fix(relinker): reject non-regular input files #2294
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2294"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Vabian124 on 2026-10-09T14:53:08Z.
What
FileReader::Readrejects a path that is not a regular file before it sizes the input buffer fromifstream::tellg. A directory can open, andtellgcan report an enormous size, so the relinker tried to allocate that size and threwstd::bad_alloc. A negative size now throwsCannot read filebefore the buffer is allocated.This change was written with AI assistance. The pull request author is responsible for every line.
Tested
Windows 10 (10.0.26200), PowerShell. WinLibs MinGW-w64 GCC 15.2.0 (x86_64-ucrt-posix-seh, release 15.2.0posix-14.0.0-ucrt-r7), CMake 4.3.1, Ninja 1.13.2, Python 3.12.
input_filepassed. The relinker-only ctest passed, 41/41.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by AnzouBelilita on 2026-10-09T15:15:26Z.
Independent Windows validation on PR #2294:
input_filetest passed.python tools/check_conventions.py --base upstream/mainpassed.git diff --check upstream/main...review/pr2294passed.The test was run against PR head
d40bcf2b6b26e698e6d573ac695a6c52d3ce9353, based on upstream maind70b89989473ba1f6ae13e44e079e67f1f8a44b0.This provides an independent Windows validation of the change. No production code was modified by this validation.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T05:18:27Z.
Conflicts with main in
core/relinker/CMakeLists.txt; please rebase.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:32:11Z.
Rebased onto current
main(only conflict: adjacentadd_testlines incore/relinker/CMakeLists.txtnext toinput_preservation; both kept). Relinker build and ctest green, includinginput_file. Merging once CI is green.