This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: array size problem in select.cc


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
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]