Skip to content

Commit

Permalink
Merge pull request #3247 from 4144/fixes
Browse files Browse the repository at this point in the history
Different small fixes
  • Loading branch information
MishimaHaruna authored Nov 19, 2023
2 parents 7d6b0b2 + 194dce6 commit 9119653
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -26159,8 +26159,17 @@ static int clif_parse(int fd)
}
}

if ((int)RFIFOREST(fd) < packet_len)
if ((int)RFIFOREST(fd) < packet_len) {
if (sd == NULL) {
if (packet_db[cmd].func != clif->pWantToConnection) {
ShowWarning("clif_parse: Received first unsupported packet (packet 0x%04x (0x%04x), %"PRIuS" bytes received), disconnecting session #%d.\n",
(unsigned int)cmd, RFIFOW(fd, 0), RFIFOREST(fd), fd);
sockt->eof(fd);
}
}

return 0; // not enough data received to form the packet
}

if( battle_config.packet_obfuscation == 2 || cmd != RFIFOW(fd, 0) || (sd && sd->parse_cmd_func == clif->parse_cmd_decrypt) ) {
// Note: Overriding const qualifier to re-inject the decoded packet ID.
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function run_server {
rm -rf core* || true
CRASH_PLEASE=1 $1 --run-once $2 2>runlog.txt
export errcode=$?
export teststr=$(head -c 10000 runlog.txt)
export teststr=$(head -c 10000 runlog.txt|grep -v "WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.")
if [[ -n "${teststr}" ]]; then
echo "Errors found in running server $1."
head -c 10000 runlog.txt
Expand Down

0 comments on commit 9119653

Please sign in to comment.