Possible bug in EQStreamFactory::ReaderLoop?

Old bugs stored here for reference.
Locked
ginsu
Posts: 3
Joined: Tue Jul 07, 2009 8:34 pm

Possible bug in EQStreamFactory::ReaderLoop?

Post by ginsu » Wed Mar 03, 2010 8:47 pm

In order to set the lookup for the stream ReaderLoop does this:

sprintf(temp,"%llu.%d",ntohl(from.sin_addr.s_addr),ntohs(from.sin_port));

On Linux this results in a negative port number at times, which causes the resulting string to be 26 characters, overflowing temp and resulting in a buffer overflow crash.

I believe that the format should be:

sprintf(temp,"%u.%hu",ntohl(from.sin_addr.s_addr),ntohs(from.sin_port));

I made this change locally and all seems to work well.

Cheers,
Ginsu

Locked

Who is online

Users browsing this forum: No registered users and 0 guests