reject short reads in wxIPCSocketStreams::ReadData (PR #26628)

12 views
Skip to first unread message

Javid Khan

unread,
Jun 24, 2026, 1:22:22 PM (4 days ago) Jun 24
to wx-...@googlegroups.com, Subscribed

wxIPCSocketStreams::ReadData reads a length prefix from the connection and then reads that many bytes into the buffer returned by GetBufferAtLeast, but it never checks how many bytes actually arrived. That buffer is either freshly allocated and so uninitialised or, more commonly, the connection's own buffer reused from an earlier and possibly larger message, so a peer that announces more data than it sends and then drops the link leaves the unread tail untouched and it gets handed to OnExecute/OnPoke/OnAdvise with the full announced size, quietly leaking stale process memory across the connection. The socket reads are done in WAITALL mode so a short read only happens when the peer is broken or hostile, and every caller already treats a null return from ReadData as an error, so the safe thing is to return nullptr when fewer bytes than announced were read instead of using the partial buffer.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26628

Commit Summary

  • fbc1ad1 reject short reads in wxIPCSocketStreams::ReadData

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26628@github.com>

VZ

unread,
Jun 27, 2026, 12:43:56 PM (22 hours ago) Jun 27
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26628)

Makes sense, thanks! Will merge soon.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26628/c4819261544@github.com>

Javid Khan

unread,
Jun 27, 2026, 12:59:58 PM (21 hours ago) Jun 27
to wx-...@googlegroups.com, Subscribed
dxbjavid left a comment (wxWidgets/wxWidgets#26628)

Thank you. Appreciated


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26628/c4819424908@github.com>

VZ

unread,
Jun 27, 2026, 1:58:50 PM (20 hours ago) Jun 27
to wx-...@googlegroups.com, Subscribed

Closed #26628 via df22982.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26628/issue_event/27285084035@github.com>

Reply all
Reply to author
Forward
0 new messages