diff options
author | Pascal Obry <obry@adacore.com> | 2018-05-23 10:23:59 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-23 10:23:59 +0000 |
commit | c2d2963d2c69d3a52e491e149fbaeeb5813b9e24 (patch) | |
tree | 1c3c40a150e9205fe431701f06ce6cab2d138734 /gcc/ada/adaint.c | |
parent | 7f4b58c2582067694e7f9e8944187ac5794579d0 (diff) | |
download | gcc-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.c | 4 |
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 |