diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 16:05:26 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 16:06:05 -0800 |
commit | 04bca45552b59441e41dbf4e66cb8b7ce9baa021 (patch) | |
tree | 5ede645a578488d3b81764d42d118f62b1ac26b9 /core/subsurface-qt | |
parent | b4b8a9db4e77aa015d5a90e505c1febf00ab3621 (diff) | |
download | subsurface-04bca45552b59441e41dbf4e66cb8b7ce9baa021.tar.gz |
Cleanup: avoid out of bounds access
sizeof() is clearly the wrong way to get to the size of that array...
Coverity CID 208290
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 8ea8b6370..bc7bd397c 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -280,7 +280,7 @@ QStringList DiveObjectHelper::cylinderList() const } } - for (unsigned long ti = 0; ti < sizeof(tank_info) && tank_info[ti].name != NULL; ti++) { + for (unsigned long ti = 0; ti < MAX_TANK_INFO && tank_info[ti].name != NULL; ti++) { QString cyl = tank_info[ti].name; if (cyl == EMPTY_DIVE_STRING) continue; |