Fixed potential map server crash in clif_parse_Mail_setattach (#3609)

This commit is contained in:
Jittapan Pluemsumran 2018-10-26 13:51:50 +07:00 committed by GitHub
parent 04f127fd7c
commit 2140722743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);