Issue information

Issue ID
#5555
Status
Fixed
Severity
High
Started
Hercules Elf Bot
Apr 4, 2012 20:59
Last Post
Hercules Elf Bot
Apr 18, 2012 9:37
Confirmation
Yes (1)
No (0)

Hercules Elf Bot - Apr 4, 2012 20:59

Originally posted by [b]Lighta[/b]
Ok so sorry this ain't really a bugreport since it may not cause issue (didn't try really) but I didn't see a better place to report this.
so [rev=15828] to [rev=15831] mention cleanup for old client so juste removing some #if and stuff but here some issues I don't get :
[code]
@@ -12725,9 +12353,5 @@
account_id = RFIFOL(fd,2);
char_id = RFIFOL(fd,6);
-#if PACKETVER < 6
reply = RFIFOB(fd,10);
-#else
- reply = RFIFOL(fd,10);
-#endif
[/code]
So you changing buffer size to 32 to 8 here, (taking RFIFOB instead RFIFOL)

And here it's worse :
[code]
@@ -1202,13 +1142,8 @@
static void clif_setdisguise(struct block_list *bl, unsigned char *buf,int len)
{
-#if PACKETVER >= 20091103
WBUFB(buf,4)= pcdb_checkid(status_get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
WBUFL(buf,5)=-bl->id;
-#elif PACKETVER >= 20071106
WBUFB(buf,2)= pcdb_checkid(status_get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
WBUFL(buf,3)=-bl->id;
-#else
- WBUFL(buf,2)=-bl->id;
-#endif
clif_send(buf, len, bl, SELF);
}
[/code]
Here you keeping if and elsif condition wich oviously lead to packet overleap.

Both of them are in r15828, there may be other kind of issues I didn't check the rest. If you could retake a look or explain I'd be glad.

This post has been edited by Brian on Apr 4, 2012 21:03

Hercules Elf Bot - Apr 7, 2012 11:32

Originally posted by [b]xazax[/b]
You are absolutely right here, thanks for noticing those.

Hercules Elf Bot - Apr 7, 2012 18:09

Originally posted by [b]xazax[/b]
Fixed in [rev=15833].