Changeset b4b8a9d in subsurface


Ignore:
Timestamp:
Dec 26, 2017, 3:57:45 PM (4 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
04bca45
Parents:
50571df
git-author:
Dirk Hohndel <dirk@…> (12/26/17 15:42:32)
git-committer:
Dirk Hohndel <dirk@…> (12/26/17 15:57:45)
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mobile-widgets/qmlmanager.cpp

    r2c8614e rb4b8a9d  
    988988                unsigned long i;
    989989                int size = 0, wp = 0;
    990                 for (i = 0; i < sizeof(tank_info) && tank_info[i].name != NULL; i++) {
     990                for (i = 0; i < MAX_TANK_INFO && tank_info[i].name != NULL; i++) {
    991991                        if (tank_info[i].name == cylinder ) {
    992992                                if (tank_info[i].ml > 0){
Note: See TracChangeset for help on using the changeset viewer.