diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-05-13 21:33:25 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-05-13 21:33:25 -0500 |
| commit | be37c33b6657060232555d17386557145f3b6666 (patch) | |
| tree | bf121b4273048379607764366290c9630470abe0 /libs/plugin_python/src/mobase/pybind11_all.h | |
| parent | 8b4f9596d3e2b437317418b0af1aad68db056ee2 (diff) | |
nxm: drain socket lines before emitting to dodge use-after-free
processSocketData iterated socket->canReadLine() and emit'd nxmReceived
inside the loop. nxmReceived routes to OrganizerCore which can show a
modal dialog (the "Wrong Game" warning fires whenever the link's game
domain doesn't match the active instance). Modal dialogs spin the event
loop, and the loop processes the disconnected → deleteLater queued for
the same socket. The socket gets freed, then control returns to the
while loop and the next canReadLine() runs on a dangling pointer.
Repro hits cleanly when an nxm:// for a non-matching game arrives — the
"Wrong Game" dialog appears and as soon as the user dismisses it MO2
crashes with SIGSEGV. Read into a QStringList first, then emit after
the read loop ends so the socket is no longer touched once handlers run.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'libs/plugin_python/src/mobase/pybind11_all.h')
0 files changed, 0 insertions, 0 deletions
