mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[7582] Prevent memory corruption at DBC loading. Thanks to Lynx3d for investigating that issue
This commit is contained in:
parent
ae42ce6418
commit
ab7491e0e1
2 changed files with 7 additions and 2 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include "Policies/SingletonImp.h"
|
||||
#include "Log.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
#include "DBCfmt.h"
|
||||
|
||||
|
|
@ -391,9 +392,13 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
if(!talentTabInfo)
|
||||
continue;
|
||||
|
||||
// prevent memory corruption; otherwise cls will become 12 below
|
||||
if (! talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE)
|
||||
continue;
|
||||
|
||||
// store class talent tab pages
|
||||
uint32 cls = 1;
|
||||
for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < 12 /*MAX_CLASSES*/;m <<=1, ++cls) {}
|
||||
for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES;m <<=1, ++cls) {}
|
||||
|
||||
sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7581"
|
||||
#define REVISION_NR "7582"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue