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
Description: PGP signature