mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 10:43:44 +01:00
Safety check in sceNetInetSelect
This commit is contained in:
1 parent
7e3079b035
commit
cf8afb9490
1 file changed
+12
@@ -252,6 +252,10 @@ int sceNetInetSelect(int nfds, u32 readfdsPtr, u32 writefdsPtr, u32 exceptfdsPtr
|
||||
if (readfds && (NetInetFD_ISSET(i, readfds))) {
|
||||
SOCKET sock = g_socketManager.GetHostSocketFromInetSocket(i);
|
||||
_dbg_assert_(sock != 0);
|
||||
if (sock < 0) {
|
||||
ERROR_LOG(Log::sceNet, "Bad socket #%d in readfds", i);
|
||||
continue;
|
||||
}
|
||||
hostSockets[i] = sock;
|
||||
if (sock > maxHostSocket)
|
||||
maxHostSocket = sock;
|
||||
@@ -266,6 +270,10 @@ int sceNetInetSelect(int nfds, u32 readfdsPtr, u32 writefdsPtr, u32 exceptfdsPtr
|
||||
if (writefds && (NetInetFD_ISSET(i, writefds))) {
|
||||
SOCKET sock = g_socketManager.GetHostSocketFromInetSocket(i);
|
||||
_dbg_assert_(sock != 0);
|
||||
if (sock < 0) {
|
||||
ERROR_LOG(Log::sceNet, "Bad socket #%d in writefds", i);
|
||||
continue;
|
||||
}
|
||||
hostSockets[i] = sock;
|
||||
if (sock > maxHostSocket)
|
||||
maxHostSocket = sock;
|
||||
@@ -280,6 +288,10 @@ int sceNetInetSelect(int nfds, u32 readfdsPtr, u32 writefdsPtr, u32 exceptfdsPtr
|
||||
if (exceptfds && (NetInetFD_ISSET(i, exceptfds))) {
|
||||
SOCKET sock = g_socketManager.GetHostSocketFromInetSocket(i);
|
||||
_dbg_assert_(sock != 0);
|
||||
if (sock < 0) {
|
||||
ERROR_LOG(Log::sceNet, "Bad socket #%d in exceptfds", i);
|
||||
continue;
|
||||
}
|
||||
hostSockets[i] = sock;
|
||||
if (sock > maxHostSocket)
|
||||
maxHostSocket = sock;
|
||||
|
||||
Reference in new issue
Block a user