public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: sigproc: Fix a thinko in array size
Date: Fri, 28 Aug 2020 17:38:28 +0000 (GMT)	[thread overview]
Message-ID: <20200828173828.2FD43394743E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=bf251d5a0b644f7b5165a404822d88f532593160

commit bf251d5a0b644f7b5165a404822d88f532593160
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Aug 28 19:38:05 2020 +0200

    Cygwin: sigproc: Fix a thinko in array size
    
    We need one more entry than max children in the arrays.
    There's no reason to do this for the static array, though.
    One more entry in the overflow array is sufficient.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sigproc.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index aa946fb4c..2a9734f00 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -47,14 +47,14 @@ char NO_COPY myself_nowait_dummy[1] = {'0'};
 /* All my children info.  Avoid expensive constructor ops at DLL startup */
 class child_procs {
 #ifdef __i386__
-    static const int _NPROCS = 255;
+    static const int _NPROCS = 256;
     static const int _NPROCS_2 = 1023;
 #else
-    static const int _NPROCS = 1023;
+    static const int _NPROCS = 1024;
     static const int _NPROCS_2 = 4095;
 #endif
     int _count;
-    uint8_t _procs[(_NPROCS + 1) * sizeof (pinfo)] __attribute__ ((__aligned__));
+    uint8_t _procs[_NPROCS * sizeof (pinfo)] __attribute__ ((__aligned__));
     pinfo *_procs_2;
   public:
     int count () const { return _count; }


                 reply	other threads:[~2020-08-28 17:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200828173828.2FD43394743E@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).