Files
ppsspp/Core
Henrik RydgårdandClaude Opus 5 7e79334c18 ELF: bound the segment table, and reject ELFs with no loadable segment
segmentVAddr is a 32-entry array, but LoadInto filled it from e_phnum, which is
a u16 - so an ELF declaring 65535 program headers wrote 65535 u32s into it,
straight through the rest of the ElfReader object. The only check standing in
front of that verified the program headers fit in the file, which a ~2MB crafted
PRX satisfies. Rejected up front now: LoadRelocations already ignores segment
numbers at or past the array size, so a module with more than that couldn't be
relocated correctly anyway. Real modules have a handful - PSP_Header::nsegments
is a u8 and no more than 4 are ever used.

Second one from the same loop: with no PT_LOAD segment at all, totalStart stayed
0xFFFFFFFF and totalEnd 0, so totalSize came out as 1 (0 - 0xFFFFFFFF) and the
loader went on to allocate a 1-byte block at 0xFFFFFFFF.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
2026-08-19 19:19:06 +02:00
..
2026-08-11 20:12:10 +02:00
2026-08-17 13:11:16 +02:00
2026-06-02 11:15:08 +02:00
2026-08-05 09:48:51 +02:00
2026-08-05 00:15:56 +02:00
2026-08-11 20:14:01 +02:00
2026-07-29 16:27:33 +02:00
2026-08-11 15:43:48 +02:00
2026-07-27 18:37:28 +02:00
2026-08-15 18:31:20 +02:00