Skip to content

Commit

Permalink
Merge pull request #10 from cniethammer/fix-tst_env_get_version
Browse files Browse the repository at this point in the history
Fix array out-of-bounds access in tst_env_get_version
  • Loading branch information
cniethammer authored Feb 16, 2023
2 parents 1ea0f5d + 4774fd9 commit 9776143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion env/tst_env_get_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int tst_env_get_version_run (struct tst_env * env)

int valid_mpi_versions[][2] = { {3,1}, {3,0}, {2,2}, {2,1}, {2,0}, {1,2} };
int i;
for( i = 0; i < sizeof(valid_mpi_versions); i++) {
for( i = 0; i < (sizeof(valid_mpi_versions)/sizeof(valid_mpi_versions[0])); i++) {
if( valid_mpi_versions[i][0] == version && valid_mpi_versions[i][1] == subversion) {
return 0;
}
Expand Down

0 comments on commit 9776143

Please sign in to comment.