Skill power: bounds-check skill group/level (party crash), level 120 test results

A player row with skill_group 50 made CParty::ComputeRolePoint index past
m_aiSkillPowerByLevelFromType and crash the core once the character was in a party.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-17 12:17:59 +09:00
co-authored by Claude Opus 5.5
parent c9268424ab
commit e097b927de
2 changed files with 14 additions and 2 deletions
+5 -1
View File
@@ -31,12 +31,16 @@ void CTableBySkill::DeleteAll()
int CTableBySkill::GetSkillPowerByLevelFromType(int job, int skillgroup, int skilllevel, bool bMob) const
{
// A bad skill_group or level in the player row (live has skill_group 50) indexed past the table and crashed the core
if (skilllevel < 0 || skilllevel > SKILL_MAX_LEVEL)
return 0;
if (bMob)
{
return m_aiSkillPowerByLevelFromType[0][skilllevel];
}
if (job >= JOB_MAX_NUM || skillgroup == 0)
if (job < 0 || job >= JOB_MAX_NUM || skillgroup < 1 || skillgroup > 2)
return 0;
int idx = (job * 2) + (skillgroup - 1);