diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-05-26 16:38:26 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-05-26 16:38:26 +0000 |
commit | 9e6eb48f7786b528934108b636cc0e7357cd8d64 (patch) | |
tree | 5e1e84a2c97cf5bcb035628ca7372b75afdfff78 /openmp/runtime/src | |
parent | ff8007711a5a3110d0d2f03808e50e0fe2a5d8fd (diff) | |
download | bcm5719-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.c | 2 |
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++; } |