소스 검색

Fixed a possible mapserver crash

Lemongrass3110 6 년 전
부모
커밋
ae89b3a7b2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/map/mail.cpp

+ 1 - 1
src/map/mail.cpp

@@ -143,7 +143,7 @@ enum mail_attach_result mail_setitem(struct map_session_data *sd, short idx, uin
 
 		idx -= 2;
 
-		if( idx < 0 || idx >= MAX_INVENTORY )
+		if( idx < 0 || idx >= MAX_INVENTORY || sd->inventory_data[idx] == nullptr )
 			return MAIL_ATTACH_ERROR;
 
 #if PACKETVER < 20150513