Просмотр исходного кода

Fixed potential map server crash in clif_parse_Mail_setattach (#3609)

Jittapan Pluemsumran 6 лет назад
Родитель
Сommit
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);