Skip to content

Commit

Permalink
Fix coverity warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hoene committed Jan 24, 2021
1 parent 4c1806c commit 8dda834
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hdf/dataobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ static int readOHDRHeaderMessageDataspace1(struct READER *reader,
if (i < 4) {
ds->dimension_size[i] =
readValue(reader, reader->superblock.size_of_lengths);
mylog(" dimension %d %" PRIu64 "\n", i, ds->dimension_size[i]);
if (ds->dimension_size[i] > 1000000) {
if (ds->dimension_size[i] < 0 || ds->dimension_size[i] > 1000000) {
mylog("dimension_size is too large\n"); // LCOV_EXCL_LINE
return MYSOFA_INVALID_FORMAT; // LCOV_EXCL_LINE
}
mylog(" dimension %d %" PRIu64 "\n", i, ds->dimension_size[i]);
} else
readValue(reader, reader->superblock.size_of_lengths);
}
Expand Down

0 comments on commit 8dda834

Please sign in to comment.