浏览代码

Fixed potential map server crash in clif_parse_Mail_setattach (#3609)

Jittapan Pluemsumran 6 年之前
父节点
当前提交
2140722743
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/map/clif.cpp

+ 1 - 1
src/map/clif.cpp

@@ -15777,7 +15777,7 @@ void clif_parse_Mail_setattach(int fd, struct map_session_data *sd){
 
 	if( !chrif_isconnected() )
 		return;
-	if (idx < 0 || amount < 0)
+	if (idx < 0 || amount < 0 || idx >= MAX_INVENTORY)
 		return;
 
 	flag = mail_setitem(sd, idx, amount);