bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in telnet from inetutils-2.2: Insufficient buffer space for long


From: Joerg Mayer
Subject: Re: Bug in telnet from inetutils-2.2: Insufficient buffer space for longish DISPLAY names
Date: Mon, 7 Feb 2022 12:00:26 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Feb 05, 2022 at 05:18:01PM +0100, Erik Auerswald wrote:
[ots of interesting stuff deleted]

I agree with Erik's analysis and conclusions. As any "relevant" telnet 
implementation
should also implement the NEWENV option there should not even be a loss of 
functionality
by staying with the original buffer size.

> diff -Naur inetutils-2.2.orig/telnet/telnet.c 
> inetutils-2.2.changed/telnet/telnet.c
> --- inetutils-2.2.orig/telnet/telnet.c        2021-05-25 17:54:19.000000000 
> +0200
> +++ inetutils-2.2.changed/telnet/telnet.c     2022-02-05 16:31:43.474464119 
> +0100
> @@ -1011,11 +1011,13 @@
>         /* Remote host, and display server must not be corrupted
>          * by truncation.  In addition, every character of telnet
>          * protocol must remain unsevered.  Check that DP fits in
> -        * full within TEMP.  Otherwise report buffer error.
> +        * full within TEMP.  Otherwise report buffer error and
> +        * turn off the option.
>          */
>         if (strlen ((char *) dp) >= sizeof (temp) - 4 - 2)
>           {
> -           printf ("lm_will: not enough room in buffer\n");
> +           printf ("lm_will: not enough room in buffer for DISPLAY\n");
> +           send_wont (TELOPT_XDISPLOC, 1);
>             break;
>           }
>  

I prefer Erik's patch over mine.

Kind regards
   Jörg

-- 
Joerg Mayer                                           <jmayer@loplof.de>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]