Login
User Name:

Password:



Register

Forgot your password?
Hi - Clean SmaugFuss map/description issue..
Dec 15, 2024 7:29 pm
By Samson
AFKMud 2.2.4
Dec 10, 2024 4:09 pm
By Samson
I3 and IMC
Dec 8, 2024 6:35 pm
By Remcon
Ubuntu 22.04.5 LTS
Dec 5, 2024 5:10 pm
By Remcon
SmaugFUSS 1.8/1.9
Nov 29, 2024 11:46 am
By Remcon
SWFOTEFUSS 1.5.1
Author: Various
Submitted by: Samson
SWRFUSS 1.4.1
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.5
Author: Various
Submitted by: Samson
AFKMud 2.2.4
Author: AFKMud Team
Submitted by: Samson
LOP 1.5
Author: Remcon
Submitted by: Remcon
Users Online
AhrefsBot, Bing

Members: 0
Guests: 13
Stats
Files
Topics
Posts
Members
Newest Member
494
3,808
19,707
588
Mortrex

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Bugfix Lists » SWFOTE FUSS Bugfix List » [Bug] Telnet control characte...
Forum Rules | Mark all | Recent Posts

[Bug] Telnet control character arrays are of the wrong type.
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 16, 2010 5:02 pm   
Go to the top of the page
Go to the bottom of the page

InfiniteAxis
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006

 
Bug: Telnet control character arrays are of the wrong type.
Danger: Low - May or may not be interfering with the use of the telnet IAC command.
Found by: Bobo
Fixed by: David/Samson

---

comm.c

Locate:
const char echo_off_str[] = { ( char )IAC, ( char )WILL, TELOPT_ECHO, '\0' };
const char echo_on_str[] = { ( char )IAC, ( char )WONT, TELOPT_ECHO, '\0' };
const char go_ahead_str[] = { ( char )IAC, ( char )GA, '\0' };


Replace with:
const unsigned char echo_off_str[] = { IAC, WILL, TELOPT_ECHO, '\0' };
const unsigned char echo_on_str[] = { IAC, WONT, TELOPT_ECHO, '\0' };
const unsigned char go_ahead_str[] = { IAC, GA, '\0' };


In new_descriptor, locate:
   write_to_buffer( dnew, will_compress2_str, 0 );


Change to:
   write_to_buffer( dnew, (const char *)will_compress2_str, 0 );


In flush_buffer, locate:
         write_to_buffer( d, go_ahead_str, 0 );


Change to:
         write_to_buffer( d, (const char *)go_ahead_str, 0 );


In nanny_get_name, locate:
      write_to_buffer( d, echo_off_str, 0 );


Change to:
      write_to_buffer( d, (const char *)echo_off_str, 0 );


In nanny_get_old_password, locate:
   write_to_buffer( d, echo_on_str, 0 );


Change to:
   write_to_buffer( d, (const char *)echo_on_str, 0 );


In nanny_confirm_new_name, locate:
      sprintf( buf, "\r\nMake sure to use a password that won't be easily guessed by someone else."
           "\r\nPick a good password for %s: %s", ch->name, echo_off_str );


Change to:
      sprintf( buf, "\r\nMake sure to use a password that won't be easily guessed by someone else."
           "\r\nPick a good password for %s: %s", ch->name, (const char *)echo_off_str );


In nanny_confirm_new_password, locate:
   write_to_buffer( d, echo_on_str, 0 );


Change to:
   write_to_buffer( d, (const char *)echo_on_str, 0 );


mccp.c

Locate:
char will_compress2_str[] = { ( char )IAC, ( char )WILL, TELOPT_COMPRESS2, '\0' };
char start_compress2_str[] = { ( char )IAC, ( char )SB, TELOPT_COMPRESS2, ( char )IAC, ( char )SE, '\0' };


Change to:
const unsigned char will_compress2_str[] = { IAC, WILL, TELOPT_COMPRESS2, '\0' };
const unsigned char start_compress2_str[] = { IAC, SB, TELOPT_COMPRESS2, IAC, SE, '\0' };


In compressStart, locate:
   write_to_descriptor( d, start_compress2_str, 0 );


Change to:
   write_to_descriptor( d, (const char *)start_compress2_str, 0 );


mccp.h

Locate:
extern char will_compress2_str[];
extern char start_compress2_str[];


Change to:
extern const unsigned char will_compress2_str[];
extern const unsigned char start_compress2_str[];


Telnet opt codes exist in the high range of an unsigned char. The arrays as defined were set up as signed chars, and therefore it was entirely possible the values could be interpreted wrong when assigned.

This was originally reported here: http://www.gammon.com.au/forum/?id=10662

Pages:<< prev 1 next >>