From 45d8123e73ea9b213ad57c32524286fe44a08721 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 24 Oct 2013 05:02:16 -0200 Subject: 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 --- src/map/itemdb.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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 -- cgit v1.2.3-60-g2f50