aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2018-05-23 10:23:59 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-23 10:23:59 +0000
commitc2d2963d2c69d3a52e491e149fbaeeb5813b9e24 (patch)
tree1c3c40a150e9205fe431701f06ce6cab2d138734 /gcc/ada/adaint.c
parent7f4b58c2582067694e7f9e8944187ac5794579d0 (diff)
downloadgcc-c2d2963d2c69d3a52e491e149fbaeeb5813b9e24.zip
gcc-c2d2963d2c69d3a52e491e149fbaeeb5813b9e24.tar.gz
gcc-c2d2963d2c69d3a52e491e149fbaeeb5813b9e24.tar.bz2
[Ada] Fix computation of handle/pid lists in win32_wait
An obvious mistake due to missing parentheses was not properly computing the size of the handle and pid list passed to WaitForMultipleObjects(). This resulted in a memory corruption. 2018-05-23 Pascal Obry <obry@adacore.com> gcc/ada/ * adaint.c (win32_wait): Add missing parentheses. From-SVN: r260598
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 9e0919e..07e55e4 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -2591,10 +2591,10 @@ win32_wait (int *status)
#else
/* Note that index 0 contains the event handle that is signaled when the
process list has changed */
- hl = (HANDLE *) xmalloc (sizeof (HANDLE) * hl_len + 1);
+ hl = (HANDLE *) xmalloc (sizeof (HANDLE) * (hl_len + 1));
hl[0] = ProcListEvt;
memmove (&hl[1], HANDLES_LIST, sizeof (HANDLE) * hl_len);
- pidl = (int *) xmalloc (sizeof (int) * hl_len + 1);
+ pidl = (int *) xmalloc (sizeof (int) * (hl_len + 1));
memmove (&pidl[1], PID_LIST, sizeof (int) * hl_len);
hl_len++;
#endif