mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-01-09 11:17:30 -03:00
nsysnet: Avoid crash on NULL timeout in select (#1324)
This commit is contained in:
parent
9a53b19403
commit
b06990607d
1 changed files with 8 additions and 0 deletions
|
@ -1210,6 +1210,14 @@ void nsysnetExport_select(PPCInterpreter_t* hCPU)
|
||||||
|
|
||||||
timeval tv = { 0 };
|
timeval tv = { 0 };
|
||||||
|
|
||||||
|
if (timeOut == NULL)
|
||||||
|
{
|
||||||
|
// return immediately
|
||||||
|
cemuLog_log(LogType::Socket, "select returned immediately because of null timeout");
|
||||||
|
osLib_returnFromFunction(hCPU, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint64 msTimeout = (_swapEndianU32(timeOut->tv_usec) / 1000) + (_swapEndianU32(timeOut->tv_sec) * 1000);
|
uint64 msTimeout = (_swapEndianU32(timeOut->tv_usec) / 1000) + (_swapEndianU32(timeOut->tv_sec) * 1000);
|
||||||
uint32 startTime = GetTickCount();
|
uint32 startTime = GetTickCount();
|
||||||
while (true)
|
while (true)
|
||||||
|
|
Loading…
Reference in a new issue