Skip to content

Commit

Permalink
missing null pointer check, just close dialog if no hostname was spec…
Browse files Browse the repository at this point in the history
…ified, fixes issue #4703
  • Loading branch information
Brad Parker committed Mar 14, 2017
1 parent 137f8df commit 32a5c1a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions menu/cbs/menu_cbs_ok.c
Original file line number Diff line number Diff line change
Expand Up @@ -4022,9 +4022,18 @@ static void action_ok_netplay_enable_client_hostname_cb(
void *ignore, const char *hostname)
{
char tmp_hostname[512];
strlcpy(tmp_hostname, hostname, sizeof(tmp_hostname));
if (hostname[0])

if (hostname && hostname[0])
{
strlcpy(tmp_hostname, hostname, sizeof(tmp_hostname));
command_event(CMD_EVENT_NETPLAY_INIT, (void *) tmp_hostname);
}
else
{
menu_input_dialog_end();
return;
}

menu_input_dialog_end();

/* Force the menu to close */
Expand Down

0 comments on commit 32a5c1a

Please sign in to comment.