summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-10-24 05:02:16 -0200
committershennetsind <ind@henn.et>2013-10-24 05:02:16 -0200
commit45d8123e73ea9b213ad57c32524286fe44a08721 (patch)
treedcda0a256e3c11d731543f9efef45abb4e7c1e8a /src
parent065071b8032997d32c02ae7834c81566f027532e (diff)
downloadhercules-45d8123e73ea9b213ad57c32524286fe44a08721.tar.gz
hercules-45d8123e73ea9b213ad57c32524286fe44a08721.tar.bz2
hercules-45d8123e73ea9b213ad57c32524286fe44a08721.tar.xz
hercules-45d8123e73ea9b213ad57c32524286fe44a08721.zip
Fixed Bug #7781
Item parsing was missing a check for IDs beyond maximum and allowing them to remain in the system which can cause numerous issues including the one in the report http://hercules.ws/board/tracker/issue-7781-mapcrash-when-add-itemid-above-50k-in-itemdb2/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/itemdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 5c698b3c9..feb17ddc8 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1584,6 +1584,9 @@ int itemdb_parse_dbrow(char** str, const char* source, int line, int scriptopt)
if( nameid <= 0 ) {
ShowWarning("itemdb_parse_dbrow: Invalid id %d in line %d of \"%s\", skipping.\n", nameid, line, source);
return 0;
+ } else if ( nameid >= MAX_ITEMDB ) {
+ ShowWarning("itemdb_parse_dbrow: Invalid id %d in line %d of \"%s\", beyond MAX_ITEMDB, skipping.\n", nameid, line, source);
+ return 0;
}
//ID,Name,Jname,Type,Price,Sell,Weight,ATK,DEF,Range,Slot,Job,Job Upper,Gender,Loc,wLV,eLV,refineable,View