Skip to content

Commit 86012cf

Browse files
Fix another UAF that could be causing crashes
1 parent ec0d4b9 commit 86012cf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

requests.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,12 @@ handle_request(PTP_CALLBACK_INSTANCE inst, void *reqArg, PTP_WORK work)
571571
{
572572
Request *req;
573573
HANDLE doneEvent;
574+
HANDLE readyEvent;
574575
bool done;
575576

576577
req = (Request *)reqArg;
577578
doneEvent = req->doneEvent;
579+
readyEvent = req->readyEvent;
578580
done = false;
579581
while (!done) {
580582
if (req->source == REQ_SRC_UNSET) {
@@ -600,7 +602,7 @@ handle_request(PTP_CALLBACK_INSTANCE inst, void *reqArg, PTP_WORK work)
600602
} else {
601603
/* notify main thread to pipe progress to the plugin */
602604
PostMessageW(hwnd, ioMsg, (WPARAM)NULL, (LPARAM)req);
603-
WaitForSingleObject(req->readyEvent, INFINITE);
605+
WaitForSingleObject(readyEvent, INFINITE);
604606
}
605607
}
606608

0 commit comments

Comments
 (0)