From ae89b3a7b2aeac15c67478da0d36985814c08391 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Thu, 16 Aug 2018 21:15:25 +0200 Subject: [PATCH] Fixed a possible mapserver crash --- src/map/mail.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/mail.cpp b/src/map/mail.cpp index f2c551cfca..072f1c0538 100644 --- a/src/map/mail.cpp +++ b/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