diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 15:42:32 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 15:57:45 -0800 |
commit | b4b8a9db4e77aa015d5a90e505c1febf00ab3621 (patch) | |
tree | 8d3526efd94fc9bbe430c199132a2cd255c8fde6 /mobile-widgets | |
parent | 50571dfab38a935003806706478780bf835cc13d (diff) | |
download | subsurface-b4b8a9db4e77aa015d5a90e505c1febf00ab3621.tar.gz |
Cleanup: avoid out of bounds access
sizeof() is clearly the wrong way to get to the size of that array...
Coverity CID 208297
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 20844526d..d703c2192 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -987,7 +987,7 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q diveChanged = true; unsigned long i; int size = 0, wp = 0; - for (i = 0; i < sizeof(tank_info) && tank_info[i].name != NULL; i++) { + for (i = 0; i < MAX_TANK_INFO && tank_info[i].name != NULL; i++) { if (tank_info[i].name == cylinder ) { if (tank_info[i].ml > 0){ size = tank_info[i].ml; |