summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2015-05-26 16:38:26 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2015-05-26 16:38:26 +0000
commit9e6eb48f7786b528934108b636cc0e7357cd8d64 (patch)
tree5e1e84a2c97cf5bcb035628ca7372b75afdfff78 /openmp/runtime/src
parentff8007711a5a3110d0d2f03808e50e0fe2a5d8fd (diff)
downloadbcm5719-llvm-9e6eb48f7786b528934108b636cc0e7357cd8d64.tar.gz
bcm5719-llvm-9e6eb48f7786b528934108b636cc0e7357cd8d64.zip
One line fix for possible out-of-bounds issue in kmp_runtime.c
The variable j is now checked so there is no possible out-of-bounds issue when accessing __kmp_nested_nth.nth[] array. llvm-svn: 238216
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/kmp_runtime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_runtime.c b/openmp/runtime/src/kmp_runtime.c
index 4ab998ba1e0..195f8a1db61 100644
--- a/openmp/runtime/src/kmp_runtime.c
+++ b/openmp/runtime/src/kmp_runtime.c
@@ -6626,7 +6626,7 @@ __kmp_do_middle_initialize( void )
// If there were empty places in num_threads list (OMP_NUM_THREADS=,,2,3), correct them now
j = 0;
- while ( __kmp_nested_nth.used && ! __kmp_nested_nth.nth[ j ] ) {
+ while ( ( j < __kmp_nested_nth.used ) && ! __kmp_nested_nth.nth[ j ] ) {
__kmp_nested_nth.nth[ j ] = __kmp_dflt_team_nth = __kmp_dflt_team_nth_ub = __kmp_avail_proc;
j++;
}
OpenPOWER on IntegriCloud