diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-06-07 18:46:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-06-07 18:59:57 +0300 |
commit | d35d480881eb8491f360d016564997540796aacd (patch) | |
tree | 1837c1595bbaab1ebec25ef9537cba99d6b3b4ee /src/map/clif.c | |
parent | fb16806ce0588414c5b808df535b72ef9e7ff6ba (diff) | |
download | hercules-d35d480881eb8491f360d016564997540796aacd.tar.gz hercules-d35d480881eb8491f360d016564997540796aacd.tar.bz2 hercules-d35d480881eb8491f360d016564997540796aacd.tar.xz hercules-d35d480881eb8491f360d016564997540796aacd.zip |
Fix clif_parse_OpenVending with empty items list.
Also add cast to int for packet sizes.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index a4d2f62b1..6e572c143 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11081,7 +11081,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) __attribute_ /// 1 = public void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) { - int len = RFIFOW(fd,2)-15; + int len = (int)RFIFOW(fd, 2) - 15; int limit; bool pub; const char *password; //not zero-terminated @@ -11137,7 +11137,7 @@ void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) __attr /// 1 = public void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) { - int len = RFIFOW(fd,2)-15; + int len = (int)RFIFOW(fd, 2) - 15; int limit; bool pub; const char *password; // not zero-terminated @@ -13148,12 +13148,12 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) __attribute__(( /// 0 = canceled /// 1 = open void clif_parse_OpenVending(int fd, struct map_session_data* sd) { - short len = (short)RFIFOW(fd,2) - 85; + int len = (int)RFIFOW(fd, 2) - 85; const char *message; bool flag; const uint8 *data; - if (len < 1) + if (len < 0) return; message = RFIFOP(fd,4); |