Commit Graph
7 Commits
Author SHA1 Message Date
Henrik Rydgård feefbfcba0 Apply Nemo's feedback 2026-08-10 11:29:02 +02:00
Henrik RydgårdandClaude Sonnet 5 37cea65e0e WebsocketServer: cap message size, avoid UB on empty-vector payloads
ReadFrame() accepted a 64-bit client-supplied payload length with only
a top-bit check, and ReadPending() immediately resized a buffer by it
before any data had arrived - a single frame claiming a huge length
(reachable via the WebSocket debugger endpoint) could trigger a
multi-exabyte allocation attempt. Now rejected up front (both the
single frame and the fragmented-message total) against a 64MB cap.

Also replaced &payload[0]/&vector[0] with .data() in the send/receive
paths - operator[] on a possibly-empty vector (e.g. an empty PING) is
UB even when the result is never dereferenced.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4QAoxV2KY7ek4PcZw3WvY
2026-08-10 11:26:24 +02:00
Henrik Rydgård c3aa0f7452 Centralize socket-related includes, introduce socket_errno
This resolves some weird inconsistentes and include order problems
related to errno. Needed for the next steps.
2025-01-08 12:42:45 +01:00
Henrik Rydgård 93bb113009 Common: Rename Download to Request, and the old Request to ServerRequest. 2023-07-21 22:12:00 +02:00
Unknown W. Brackets 2af40d07bb Debugger: Fix websocket read silly mistake.
Surprised I didn't notice this before.
2021-05-30 15:25:41 -07:00
Unknown W. Brackets 7e21e9a721 Common: Cleanup some mismatched indentation.
Also move initialization from constructors in a few places.
2021-04-30 22:59:41 -07:00
Henrik Rydgård 4f43cff5ca Move fileutil, net, image loaders, ui to Common. (#13506)
* Move and rename file_util/fd_util to Common/File/FileUtil and DirListing

Let's also move net while we're at it.

Move the ZIM/PNG loaders over to Common.

Move the UI framework into Common

iOS buildfix

* Buildfix

* Buildfixes

* Apple buildfix

* This typo again..

* UWP buildfix

* Fix build of PPSSPPQt, such as it is (it's not in good condition...)

* Guess what? Another buildfix.
2020-10-04 20:48:47 +02:00