Commit Graph
7 Commits
Author SHA1 Message Date
Henrik Rydgård 98e8ffe7cd Check framebuffer copy sources, and fix two easy crashes
The three framebuffer upload paths took Memory::GetPointerUnchecked() on a
GE-supplied source address and then read height rows of it, without ever checking
that span was mapped. Only the destination was validated (and DoBlockTransfer's own
memcpy is carefully guarded, so the intent was clearly there). A copy whose source
starts near the end of RAM walks straight off the end of the view. Clamp the row
count to what's actually mapped, and warn when we do.

GhidraClient dereferenced getArray()->value for both "symbols" and "types" without a
null check, and the getTag() test underneath could never catch it - getArray() has
already filtered by tag, so it returns either a JSON_ARRAY node or nullptr. Any
HTTP 200 that parses as JSON but isn't the shape we expect - {}, a bare array, an
incompatible ghidra-rest-api, or the host/port pointed at some other JSON service -
crashed the worker thread. FetchTypes() runs first, so that's the one you'd hit.

RiscV and LoongArch CPU detection divided TotalLogicalCount() by ProcessorCount()
before checking it. ProcessorCount() returns 0 whenever /proc/cpuinfo can't be read
or doesn't parse, which is SIGFPE during static init of the cpu_info global - before
anything could handle it. The existing <= 0 guard sat after the division.

314 pspautotests pass; frametests show the same 3 pre-existing failures as master.
2026-08-31 12:15:50 +02:00
Ilya Sorochan a04bb579dc Force LoongArchCPUInfoParser::TotalLogicalCount() to return int on all code paths 2024-11-19 15:40:46 +03:00
Henrik Rydgård 1f129b6dca Replace "ReadFileToString" with a few semantically clearer wrappers. 2024-01-25 09:55:54 +01:00
Henrik Rydgård e3177ac870 Make some global string pointers const, not just the strings.
Minor cleanup.
2023-12-29 14:09:45 +01:00
KatyushaScarlet f4d1a85af3 Detect the number of threads and supported features on LoongArch CPU 2023-09-02 04:58:32 +08:00
KatyushaScarlet f94bbbd747 Fix the definition of logical_cpu_count 2023-09-02 02:08:43 +08:00
KatyushaScarlet 161f56e270 Add basic support for loongarch64 2023-09-02 02:08:43 +08:00