This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: array size problem in select.cc
- From: Charles Reindorf <charles at reindorf dot com>
- To: cygwin-patches at cygwin dot com
- Date: Tue, 10 Aug 2004 16:18:37 +0100
- Subject: Re: array size problem in select.cc
- References: <20040810103704.2A6C11B57A@cgf.cx> <20040810150454.GB21680@trixie.casa.cgf.cx>
Yeah. D'oh!
On 10.08.2004 at 16:04:47, Christopher Faylor
<cgf-no-personal-reply-please@cygwin.com> wrote:
> On Tue, Aug 10, 2004 at 11:36:41AM +0100, Charles Reindorf wrote:
> >Cygwin developers,
> >
> >I was browsing in "winsup/cygwin/select.cc" from snapshot 20040808-1 and
> I
> >think I see an array size problem there, resutling in possible core dumps
> when
> >selecting about 63 file descriptors. I wonder if the following patch is
> >applicable?
>
> Thanks, but, the correct change is this:
>
> Index: select.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/select.cc,v
> retrieving revision 1.93
> diff -u -p -r1.93 select.cc
> --- select.cc 10 Apr 2004 13:45:10 -0000 1.93
> +++ select.cc 10 Aug 2004 14:24:02 -0000
> @@ -233,7 +233,7 @@ select_stuff::wait (fd_set *readfds, fd_
> counting the number of active fds. */
> while ((s = s->next))
> {
> - if (m > MAXIMUM_WAIT_OBJECTS)
> + if (m >= MAXIMUM_WAIT_OBJECTS)
> {
> set_sig_errno (EINVAL);
> return -1;
>
> I'll make that change. Thanks for the heads up.
>
> cgf
>