Quote:
Originally Posted by jooodzszsz
Code:
- void CItemUpgrade::RemovePetVisItem( FLWSUser* pUser, int nPosition, BOOL bExpired )
How you will crash here with nPosition? its impossible? oO
It will be casted to size_t (unsigned) in GetGeneralPiercingItemID() and checked later with "m_vecGeneralPiercing.size() > Nth"
"There are more bugs in SOURCE but i dont tell them hihihihihi"
|
It is not a cast, if you pass a negative Nth to FLItemElem::GetGeneralPiercingItemIDthen then Nth will stay negative.
And later in m_kPiercingOption.GetGeneralPiercingItemID the check will be successful as m_vecGeneralPiercing.size() is always bigger than a negative value.
And later you do "return m_vecGeneralPiercing.at( Nth );" which will search a value at a negative index.
This will not at 100% crash the server but can corrupt the stack and maybe crash it later or write random data into its memory.
Code:
DWORD FLItemElem::GetGeneralPiercingItemID( const size_t Nth ) const
{
return m_kPiercingOption.GetGeneralPiercingItemID( Nth );
}
const DWORD FLPiercingOption::GetGeneralPiercingItemID( const size_t Nth ) const
{
if( m_vecGeneralPiercing.empty() == false && m_vecGeneralPiercing.size() > Nth )
{
return m_vecGeneralPiercing.at( Nth );
}
return 0;
}