mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Merge pull request #7641 from meepingsnesroms/master
Add NULL check to prevent empty password from crashing RetroArch
This commit is contained in:
commit
8ba1b3f20f
@ -21,6 +21,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include <compat/strl.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <rhash.h>
|
||||
#include <retro_timers.h>
|
||||
|
||||
@ -279,7 +280,8 @@ static void handshake_password(void *ignore, const char *line)
|
||||
struct netplay_connection *connection = &netplay->connections[0];
|
||||
|
||||
snprintf(password, sizeof(password), "%08X", connection->salt);
|
||||
strlcpy(password + 8, line, sizeof(password)-8);
|
||||
if (!string_is_empty(line))
|
||||
strlcpy(password + 8, line, sizeof(password)-8);
|
||||
|
||||
password_buf.cmd[0] = htonl(NETPLAY_CMD_PASSWORD);
|
||||
password_buf.cmd[1] = htonl(sizeof(password_buf.password));
|
||||
|
Loading…
x
Reference in New Issue
Block a user