NetBSD-Bugs archive

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

Re: lib/54329: libedit: undefined terminal behavior in terminal_move_to_line (fix included)



The following reply was made to PR lib/54329; it has been noted by GNATS.

From: Jordan Lewis <jordan%cockroachlabs.com@localhost>
To: "Raphael 'kena' Poss" <knz%thaumogen.net@localhost>, gnats-bugs%netbsd.org@localhost
Cc: Nikhil Benesch <nikhil.benesch%gmail.com@localhost>
Subject: Re: lib/54329: libedit: undefined terminal behavior in
 terminal_move_to_line (fix included)
Date: Fri, 28 Jun 2019 09:55:38 -0400

 --000000000000c4630f058c62a204
 Content-Type: text/plain; charset="UTF-8"
 
  > Out of curiosity, is this a real problem, though?  Doesn't the code
  > just above verify that "where" is within screen bounds?
  > -uwe
 
 The reason we started messing with this is that if you try to restore a
 history entry that's taller than 2 lines when the cursor is at the bottom
 of the screen, the program tries to use T_DO to move the cursor, which has
 no effect, so it ends up overwriting the bottom line with the contents of
 all of the lines of the multi-line history entry.
 
 So there is a real practical problem here. Perhaps that code is supposed to
 verify the condition you say, but it doesn't work.
 
 On Fri, Jun 28, 2019 at 4:14 AM Raphael 'kena' Poss <knz%thaumogen.net@localhost>
 wrote:
 
 >
 > please respond
 >
 > -------- Forwarded Message --------
 > Subject: Re: lib/54329: libedit: undefined terminal behavior in
 > terminal_move_to_line (fix included)
 > Date: Thu, 27 Jun 2019 23:10:01 +0000 (UTC)
 > From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
 > Reply-To: gnats-bugs%netbsd.org@localhost
 > To: lib-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
 > netbsd-bugs%netbsd.org@localhost, knz%thaumogen.net@localhost
 >
 > The following reply was made to PR lib/54329; it has been noted by GNATS.
 >
 > From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
 > To: gnats-bugs%netbsd.org@localhost
 > Cc: Subject: Re: lib/54329: libedit: undefined terminal behavior in
 >  terminal_move_to_line (fix included)
 > Date: Fri, 28 Jun 2019 02:09:18 +0300
 >
 >  On Thu, Jun 27, 2019 at 05:05:01 +0000, knz%thaumogen.net@localhost wrote:
 >   > The algorithm for terminal_move_to_line() uses the DO termcap (aka
 >  > cud or parm_down_cursor), which produces undefined behavior when the
 >  > cursor is on the last line.
 >   Out of curiosity, is this a real problem, though?  Doesn't the code
 >  just above verify that "where" is within screen bounds?
 >   -uwe
 >
 >
 
 --000000000000c4630f058c62a204
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr"><div dir=3D"ltr"><div>=C2=A0&gt; Out of curiosity, is this=
  a real problem, though?=C2=A0 Doesn&#39;t the code<br>=C2=A0&gt; just abov=
 e verify that &quot;where&quot; is within screen bounds?<br>=C2=A0&gt; -uwe=
 <div class=3D"gmail-yj6qo"></div><br class=3D"gmail-Apple-interchange-newli=
 ne"></div><div>The reason we started messing with this is that if you try t=
 o restore a history entry that&#39;s taller than 2 lines when the cursor is=
  at the bottom of the screen, the program tries to use T_DO to move the cur=
 sor, which has no effect, so it ends up overwriting the bottom line with th=
 e contents of all of the lines of the multi-line history entry.</div><div><=
 br></div><div>So there is a real practical problem here. Perhaps that code =
 is supposed to verify the condition you say, but it doesn&#39;t work.</div>=
 </div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">=
 On Fri, Jun 28, 2019 at 4:14 AM Raphael &#39;kena&#39; Poss &lt;<a href=3D"=
 mailto:knz%thaumogen.net@localhost";>knz%thaumogen.net@localhost</a>&gt; wrote:<br></div><blockq=
 uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
 x solid rgb(204,204,204);padding-left:1ex"><br>
 please respond<br>
 <br>
 -------- Forwarded Message --------<br>
 Subject: Re: lib/54329: libedit: undefined terminal behavior in<br>
 terminal_move_to_line (fix included)<br>
 Date: Thu, 27 Jun 2019 23:10:01 +0000 (UTC)<br>
 From: Valery Ushakov &lt;<a href=3D"mailto:uwe%stderr.spb.ru@localhost"; target=3D"_bl=
 ank">uwe%stderr.spb.ru@localhost</a>&gt;<br>
 Reply-To: <a href=3D"mailto:gnats-bugs%netbsd.org@localhost"; target=3D"_blank">gnats-=
 bugs%netbsd.org@localhost</a><br>
 To: <a href=3D"mailto:lib-bug-people%netbsd.org@localhost"; target=3D"_blank">lib-bug-=
 people%netbsd.org@localhost</a>, <a href=3D"mailto:gnats-admin%netbsd.org@localhost"; target=3D"=
 _blank">gnats-admin%netbsd.org@localhost</a>,<br>
 <a href=3D"mailto:netbsd-bugs%netbsd.org@localhost"; target=3D"_blank">netbsd-bugs@net=
 bsd.org</a>, <a href=3D"mailto:knz%thaumogen.net@localhost"; target=3D"_blank">knz@tha=
 umogen.net</a><br>
 <br>
 The following reply was made to PR lib/54329; it has been noted by GNATS.<b=
 r>
 <br>
 From: Valery Ushakov &lt;<a href=3D"mailto:uwe%stderr.spb.ru@localhost"; target=3D"_bl=
 ank">uwe%stderr.spb.ru@localhost</a>&gt;<br>
 To: <a href=3D"mailto:gnats-bugs%netbsd.org@localhost"; target=3D"_blank">gnats-bugs@n=
 etbsd.org</a><br>
 Cc: Subject: Re: lib/54329: libedit: undefined terminal behavior in<br>
 =C2=A0terminal_move_to_line (fix included)<br>
 Date: Fri, 28 Jun 2019 02:09:18 +0300<br>
 <br>
 =C2=A0On Thu, Jun 27, 2019 at 05:05:01 +0000, <a href=3D"mailto:knz@thaumog=
 en.net" target=3D"_blank">knz%thaumogen.net@localhost</a> wrote:<br>
 =C2=A0 &gt; The algorithm for terminal_move_to_line() uses the DO termcap (=
 aka<br>
 =C2=A0&gt; cud or parm_down_cursor), which produces undefined behavior when=
  the<br>
 =C2=A0&gt; cursor is on the last line.<br>
 =C2=A0 Out of curiosity, is this a real problem, though?=C2=A0 Doesn&#39;t =
 the code<br>
 =C2=A0just above verify that &quot;where&quot; is within screen bounds?<br>
 =C2=A0 -uwe<br>
 <br>
 </blockquote></div></div>
 
 --000000000000c4630f058c62a204--
 



Home | Main Index | Thread Index | Old Index