mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[6915] Fixed use uninitialized petition type variable in petition signing code.
This commit is contained in:
parent
34bef19e63
commit
29b37f4b6c
2 changed files with 7 additions and 23 deletions
|
|
@ -449,17 +449,14 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
|||
|
||||
Field *fields;
|
||||
uint64 petitionguid;
|
||||
uint32 type;
|
||||
uint8 unk;
|
||||
uint64 ownerguid;
|
||||
recv_data >> petitionguid; // petition guid
|
||||
recv_data >> unk;
|
||||
|
||||
uint8 signs = 0;
|
||||
|
||||
QueryResult *result = CharacterDatabase.PQuery(
|
||||
"SELECT ownerguid, "
|
||||
" (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = '%u') AS signs "
|
||||
" (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = '%u') AS signs, "
|
||||
" type "
|
||||
"FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid), GUID_LOPART(petitionguid));
|
||||
|
||||
if(!result)
|
||||
|
|
@ -469,8 +466,9 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
|||
}
|
||||
|
||||
fields = result->Fetch();
|
||||
ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
signs = fields[1].GetUInt8();
|
||||
uint64 ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
uint8 signs = fields[1].GetUInt8();
|
||||
uint32 type = fields[2].GetUInt32();
|
||||
|
||||
delete result;
|
||||
|
||||
|
|
@ -488,20 +486,6 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
|||
return;
|
||||
}
|
||||
|
||||
QueryResult *result2 = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
|
||||
if(result2)
|
||||
{
|
||||
Field* fields = result2->Fetch();
|
||||
type = fields[0].GetUInt32();
|
||||
delete result2;
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outDebug("CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid));
|
||||
return;
|
||||
}
|
||||
|
||||
if(type != 9)
|
||||
{
|
||||
if(_player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6914"
|
||||
#define REVISION_NR "6915"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue