Skip to content

Commit

Permalink
Fix array out-of-bounds access in tst_env_get_version
Browse files Browse the repository at this point in the history
Thanks to BenWibking for reporting the issue.

Signed-off-by: Christoph Niethammer <niethammer@hlrs.de>
  • Loading branch information
cniethammer authored and jsquyres committed Feb 14, 2023
1 parent 1ea0f5d commit 4774fd9
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 4774fd9

Please sign in to comment.