[PATCH v2 0/4] Modify handling of several ESC sequences in xterm mode.

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

Corinna Vinschen-2
On Mar  2 18:03, Corinna Vinschen wrote:

> On Mar  1 15:38, Takashi Yano wrote:
> > Hi Hans,
> >
> > On Sat, 29 Feb 2020 19:10:02 +0100
> > Hans-Bernhard Bröker wrote:
> > > One more important note: the current implementation has a potential
> > > buffer overrun issue, because it writes first, and only then checks
> > > whether that may have overrun the buffer.  And the check itself is off
> > > by one, too:
> > >
> > > >    wpbuf[wpixput++] = x; \
> > > >    if (wpixput > WPBUF_LEN) \
> > > >     wpixput--; \
> > >
> > > That's why my latest code snippet does it differently:
> > >
> > >  >      if (ixput < WPBUF_LEN)
> > >  >        {
> > >  >          buf[ixput++] = x;
> > >  >        }
> >
> > Indeed. You are right. Thanks for pointing out that.
> > Another similar problem exists in console code of escape
> > sequence handling, so I will submit a patch for that.
> >
> > As for wpbuf, please continue to fix.
>
> Yeah, a patch in `git format-patch' format would be most welcome.
>
> For a first-time contribution (and then never again) we also need
> a 2-clause BSD license waiver per https://cygwin.com/contrib.html
I pushed wpbuf_put as a simple inline function as a stop-gap
measure so Cygwin builds on gcc 9.2.0.


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

Jon TURNEY
On 02/03/2020 19:54, Corinna Vinschen wrote:
> On Mar  2 18:03, Corinna Vinschen wrote:
>> On Mar  1 15:38, Takashi Yano wrote:
>>> Hi Hans,
[...]
>
> I pushed wpbuf_put as a simple inline function as a stop-gap
> measure so Cygwin builds on gcc 9.2.0.

\o/

https://ci.appveyor.com/project/cygwin/cygwin/builds/31190427
12