mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 19:25:35 +08:00
no more copy if the size is bigger than the ticket
This commit is contained in:
parent
be42ac9b13
commit
d6a4b7f0ba
@ -81,7 +81,7 @@ Auth_Data Auth_Manager::getTicketData( void *pTicket, int cbMaxTicket, uint32 *p
|
|||||||
|
|
||||||
#define IP4_AS_DWORD_LITTLE_ENDIAN(a,b,c,d) (((uint32_t)d)<<24 | ((uint32_t)c)<<16 | ((uint32_t)b)<<8 | (uint32_t)a)
|
#define IP4_AS_DWORD_LITTLE_ENDIAN(a,b,c,d) (((uint32_t)d)<<24 | ((uint32_t)c)<<16 | ((uint32_t)b)<<8 | (uint32_t)a)
|
||||||
|
|
||||||
Auth_Data ticket_data;
|
Auth_Data ticket_data{};
|
||||||
CSteamID steam_id = settings->get_local_steam_id();
|
CSteamID steam_id = settings->get_local_steam_id();
|
||||||
if (settings->enable_new_app_ticket)
|
if (settings->enable_new_app_ticket)
|
||||||
{
|
{
|
||||||
@ -127,7 +127,8 @@ Auth_Data Auth_Manager::getTicketData( void *pTicket, int cbMaxTicket, uint32 *p
|
|||||||
}
|
}
|
||||||
std::vector<uint8_t> ser = ticket_data.Serialize();
|
std::vector<uint8_t> ser = ticket_data.Serialize();
|
||||||
*pcbTicket = ser.size();
|
*pcbTicket = ser.size();
|
||||||
memcpy(pTicket, ser.data(), ser.size());
|
if (cbMaxTicket >= ser.size())
|
||||||
|
memcpy(pTicket, ser.data(), ser.size());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -189,7 +190,7 @@ uint32 Auth_Manager::getWebApiTicket( const char* pchIdentity )
|
|||||||
GetTicketForWebApiResponse_t data{};
|
GetTicketForWebApiResponse_t data{};
|
||||||
uint32 cbTicket = 0;
|
uint32 cbTicket = 0;
|
||||||
Auth_Data ticket_data = getTicketData(data.m_rgubTicket, STEAM_AUTH_TICKET_SIZE, &cbTicket);
|
Auth_Data ticket_data = getTicketData(data.m_rgubTicket, STEAM_AUTH_TICKET_SIZE, &cbTicket);
|
||||||
if (*cbTicket > STEAM_AUTH_TICKET_SIZE)
|
if (cbTicket > STEAM_AUTH_TICKET_SIZE)
|
||||||
return 0;
|
return 0;
|
||||||
data.m_cubTicket = (int)cbTicket;
|
data.m_cubTicket = (int)cbTicket;
|
||||||
uint32 ttt = ticket_data.number;
|
uint32 ttt = ticket_data.number;
|
||||||
|
@ -118,7 +118,7 @@ int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamID
|
|||||||
if (!pAuthBlob) return 0;
|
if (!pAuthBlob) return 0;
|
||||||
uint32 out_size = INITIATE_GAME_CONNECTION_TICKET_SIZE;
|
uint32 out_size = INITIATE_GAME_CONNECTION_TICKET_SIZE;
|
||||||
auth_manager->getTicketData(pAuthBlob, INITIATE_GAME_CONNECTION_TICKET_SIZE, &out_size);
|
auth_manager->getTicketData(pAuthBlob, INITIATE_GAME_CONNECTION_TICKET_SIZE, &out_size);
|
||||||
if (*out_size > INITIATE_GAME_CONNECTION_TICKET_SIZE)
|
if (out_size > INITIATE_GAME_CONNECTION_TICKET_SIZE)
|
||||||
return 0;
|
return 0;
|
||||||
return out_size;
|
return out_size;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user