Skip to content

Commit

Permalink
Fix buffer size issue in inter server packets
Browse files Browse the repository at this point in the history
Fixes #2369
  • Loading branch information
4144 committed Feb 11, 2019
1 parent ee51e2c commit 66844b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/char/mapif.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static int mapif_guild_withdraw(int guild_id, int account_id, int char_id, int f
// Send short member's info // Send short member's info
static int mapif_guild_memberinfoshort(struct guild *g, int idx) static int mapif_guild_memberinfoshort(struct guild *g, int idx)
{ {
unsigned char buf[23]; unsigned char buf[25];
nullpo_ret(g); nullpo_ret(g);
Assert_ret(idx >= 0 && idx < MAX_GUILD); Assert_ret(idx >= 0 && idx < MAX_GUILD);
WBUFW(buf, 0) = 0x3835; WBUFW(buf, 0) = 0x3835;
Expand Down Expand Up @@ -1423,7 +1423,7 @@ static int mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, i


static int mapif_pet_created(int fd, int account_id, struct s_pet *p) static int mapif_pet_created(int fd, int account_id, struct s_pet *p)
{ {
WFIFOHEAD(fd, 12); WFIFOHEAD(fd, 14);
WFIFOW(fd, 0) = 0x3880; WFIFOW(fd, 0) = 0x3880;
WFIFOL(fd, 2) = account_id; WFIFOL(fd, 2) = account_id;
if (p != NULL){ if (p != NULL){
Expand Down Expand Up @@ -1805,7 +1805,7 @@ static void mapif_rodex_checkname(int fd, int reqchar_id, int target_char_id, in
Assert_retv(reqchar_id > 0); Assert_retv(reqchar_id > 0);
Assert_retv(target_char_id >= 0); Assert_retv(target_char_id >= 0);


WFIFOHEAD(fd, 16 + NAME_LENGTH); WFIFOHEAD(fd, 18 + NAME_LENGTH);
WFIFOW(fd, 0) = 0x3898; WFIFOW(fd, 0) = 0x3898;
WFIFOL(fd, 2) = reqchar_id; WFIFOL(fd, 2) = reqchar_id;
WFIFOL(fd, 6) = target_char_id; WFIFOL(fd, 6) = target_char_id;
Expand Down
4 changes: 2 additions & 2 deletions src/map/intif.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int intif_create_pet(int account_id, int char_id, int pet_class, int pet_
if (intif->CheckForCharServer()) if (intif->CheckForCharServer())
return 0; return 0;
nullpo_ret(pet_name); nullpo_ret(pet_name);
WFIFOHEAD(inter_fd, 28 + NAME_LENGTH); WFIFOHEAD(inter_fd, 32 + NAME_LENGTH);
WFIFOW(inter_fd, 0) = 0x3080; WFIFOW(inter_fd, 0) = 0x3080;
WFIFOL(inter_fd, 2) = account_id; WFIFOL(inter_fd, 2) = account_id;
WFIFOL(inter_fd, 6) = char_id; WFIFOL(inter_fd, 6) = char_id;
Expand Down Expand Up @@ -907,7 +907,7 @@ static int intif_guild_memberinfoshort(int guild_id, int account_id, int char_id
{ {
if (intif->CheckForCharServer()) if (intif->CheckForCharServer())
return 0; return 0;
WFIFOHEAD(inter_fd, 19); WFIFOHEAD(inter_fd, 23);
WFIFOW(inter_fd, 0) = 0x3035; WFIFOW(inter_fd, 0) = 0x3035;
WFIFOL(inter_fd, 2) = guild_id; WFIFOL(inter_fd, 2) = guild_id;
WFIFOL(inter_fd, 6) = account_id; WFIFOL(inter_fd, 6) = account_id;
Expand Down

0 comments on commit 66844b9

Please sign in to comment.