summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-10-11 13:22:34 -0300
committershennetsind <ind@henn.et>2013-10-11 13:22:34 -0300
commit231f7a4f31b27611af7006e3adc2d3c046356fd3 (patch)
tree7a50cf8fcc99e189c856dbf4c2ef1403e93f0711 /src
parentc186b7ec18842a393718ba3d2e252af78bae0ef9 (diff)
parentdf68a8cecdb52de34a348ba63f27862678a446a7 (diff)
downloadhercules-231f7a4f31b27611af7006e3adc2d3c046356fd3.tar.gz
hercules-231f7a4f31b27611af7006e3adc2d3c046356fd3.tar.bz2
hercules-231f7a4f31b27611af7006e3adc2d3c046356fd3.tar.xz
hercules-231f7a4f31b27611af7006e3adc2d3c046356fd3.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index d1f416146..823a44956 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -17825,10 +17825,6 @@ unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) {
unsigned short clif_parse_cmd_normal( int fd, struct map_session_data *sd ) {
unsigned short cmd = RFIFOW(fd,0);
- // filter out invalid / unsupported packets
- if( cmd > MAX_PACKET_DB || cmd < MIN_PACKET_DB || packet_db[cmd].len == 0 )
- return 0;
-
return cmd;
}
unsigned short clif_parse_cmd_decrypt( int fd, struct map_session_data *sd ) {
@@ -17836,10 +17832,6 @@ unsigned short clif_parse_cmd_decrypt( int fd, struct map_session_data *sd ) {
cmd = clif->decrypt_cmd(cmd, sd);
- // filter out invalid / unsupported packets
- if( cmd > MAX_PACKET_DB || cmd < MIN_PACKET_DB || packet_db[cmd].len == 0 )
- return 0;
-
return cmd;
}
unsigned short clif_parse_cmd_optional( int fd, struct map_session_data *sd ) {
@@ -17914,7 +17906,10 @@ int clif_parse(int fd) {
else
parse_cmd_func = clif->parse_cmd;
- if( !( cmd = parse_cmd_func(fd,sd) ) ) {
+ cmd = parse_cmd_func(fd,sd);
+
+ // filter out invalid / unsupported packets
+ if( cmd > MAX_PACKET_DB || cmd < MIN_PACKET_DB || packet_db[cmd].len == 0 ) {
ShowWarning("clif_parse: Received unsupported packet (packet 0x%04x (0x%04x), %d bytes received), disconnecting session #%d.\n", cmd, RFIFOW(fd,0), RFIFOREST(fd), fd);
#ifdef DUMP_INVALID_PACKET
ShowDump(RFIFOP(fd,0), RFIFOREST(fd));