Minor pointer bug in mq2telnet

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

rmaxm
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sun Aug 02, 2015 6:34 pm

Minor pointer bug in mq2telnet

Post by rmaxm » Sun Aug 02, 2015 6:49 pm

Looks to me like a minor pointer bug in TelnetServer.cpp when a connection is closing.
The code reads:

while(Conn->Received)
{
PCHATBUF rNext=Conn->Received->pNext;
free(rNext);
Conn->Received=rNext;
}

But this is going to free the next buffer (which will probably be NULL) instead of the current buffer.

Should be:
while(Conn->Received)
{
PCHATBUF rNext=Conn->Received->pNext;
free(Conn->Received);
Conn->Received=rNext;
}

This will of course be a very very rare condition.
(The same bug exists in CTelnetServer::Shutdown).

Also, I'm not sure this is the right place to post these kind of things so let me know if there is someplace else where devs post internal bugs like this.
And should I post a diff file?

Thanks,
RMAXM

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: Minor pointer bug in mq2telnet

Post by EqMule » Wed Aug 05, 2015 8:06 pm

Thanks I'm out of the office atm I'll take a look at this when I get back but a quick glance looks good to me, thanks for the report.
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: Minor pointer bug in mq2telnet

Post by EqMule » Sat Aug 08, 2015 1:36 pm

fixed in MQ2-20150808.zip
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.










xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Minor pointer bug in mq2telnet

Post by xyilla » Sat Jan 17, 2026 12:24 pm