mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 10:10:57 +00:00
Checks for some netplay syscall errors and NULL deref errors
This commit is contained in:
parent
e48cd885f9
commit
60449e8928
@ -829,7 +829,8 @@ static int init_tcp_connection(const struct addrinfo *res,
|
||||
#if defined(IPPROTO_TCP) && defined(TCP_NODELAY)
|
||||
{
|
||||
int flag = 1;
|
||||
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(int));
|
||||
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(int)) < 0)
|
||||
RARCH_WARN("Could not set netplay TCP socket to nodelay. Expect jitter.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -99,20 +99,22 @@ uint32_t netplay_impl_magic(void)
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info);
|
||||
|
||||
if (info)
|
||||
lib = info->info.library_name;
|
||||
|
||||
res |= api;
|
||||
|
||||
len = strlen(lib);
|
||||
for (i = 0; i < len; i++)
|
||||
res ^= lib[i] << (i & 0xf);
|
||||
if (info)
|
||||
{
|
||||
lib = info->info.library_name;
|
||||
|
||||
lib = info->info.library_version;
|
||||
len = strlen(lib);
|
||||
len = strlen(lib);
|
||||
for (i = 0; i < len; i++)
|
||||
res ^= lib[i] << (i & 0xf);
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
res ^= lib[i] << (i & 0xf);
|
||||
lib = info->info.library_version;
|
||||
len = strlen(lib);
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
res ^= lib[i] << (i & 0xf);
|
||||
}
|
||||
|
||||
len = strlen(ver);
|
||||
for (i = 0; i < len; i++)
|
||||
|
@ -115,7 +115,8 @@ static bool netplay_net_pre_frame(netplay_t *netplay)
|
||||
#if defined(IPPROTO_TCP) && defined(TCP_NODELAY)
|
||||
{
|
||||
int flag = 1;
|
||||
setsockopt(netplay->fd, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(int));
|
||||
if (setsockopt(netplay->fd, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(int)) < 0)
|
||||
RARCH_WARN("Could not set netplay TCP socket to nodelay. Expect jitter.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user