This is the mail archive of the
cygwin-patches@sourceware.cygnus.com
mailing list for the Cygwin project.
[RFA]: fhandler_base::puts_readahead crashes sometimes.
- To: cygpatch <cygwin-patches at sourceware dot cygnus dot com>
- Subject: [RFA]: fhandler_base::puts_readahead crashes sometimes.
- From: Corinna Vinschen <corinna at vinschen dot de>
- Date: Tue, 09 May 2000 23:03:29 +0200
- Organization: Cygnus Solutions, a Red Hat Company
- References: <39187C1A.EAB5BFD2@vinschen.de>
- Reply-To: cygpatch <cygwin-patches at sourceware dot cygnus dot com>
Sorry, it's not a patch, it's a RFA.
Corinna
Corinna Vinschen wrote:
>
> I have found a problem in puts_readahead. When starting a ssh
> connection to another host and then trying to start vi on that
> host, ssh crashes with SIGSEGV. I could find the assassin in
> fhandler_base::puts_readahead().
>
> Corinna
>
> ChangeLog:
> ==========
>
> * fhandler.cc (fhandler_base::puts_readahead): Change
> while condition to disallow wild runs.
>
> ------------------------------------------------------------------------
> Index: fhandler.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/fhandler.cc,v
> retrieving revision 1.16
> diff -u -p -r1.16 fhandler.cc
> --- fhandler.cc 2000/05/08 16:13:54 1.16
> +++ fhandler.cc 2000/05/09 20:41:23
> @@ -22,8 +22,8 @@ int
> fhandler_base::puts_readahead (const char *s, size_t len = (size_t) -1)
> {
> int success = 1;
> - while ((((len == (size_t) -1) && *s) || len--) &&
> - (success = put_readahead (*s++) > 0))
> + while ((*s || (len != (size_t) -1 && len--))
> + && (success = put_readahead (*s++) > 0))
> continue;
> return success;
> }
--
Corinna Vinschen
Cygwin Developer
Cygnus Solutions, a Red Hat company