Prevent memcpy if data->data is NULL

This commit is contained in:
twinaphex 2017-01-22 21:47:52 +01:00
parent 8698525f86
commit 8ad2b5000f

View File

@ -3332,9 +3332,12 @@ static void netplay_refresh_rooms_cb(void *task_data, void *user_data, const cha
if (!data || err)
goto finish;
memcpy(buf, data->data, data->len * sizeof(char));
buf[data->len] = '\0';
if (data)
{
if (data->data)
memcpy(buf, data->data, data->len * sizeof(char));
buf[data->len] = '\0';
}
finish:
if (!err && !strstr(buf, file_path_str(FILE_PATH_NETPLAY_ROOM_LIST_URL)))