Menu

#1934 CellBuffer.cxx: 2 * badly placed sanity check ?

Bug
closed
nobody
scintilla (610)
5
2017-04-13
2017-04-13
dcb
No

1.

CellBuffer.cxx:350]: (style) Array index 'currentAction' is used before limits check.

Source code is

if (actions[currentAction].at == startAction && currentAction < maxAction)
    currentAction++;

CellBuffer.cxx:355]: (style) Array index 'act' is used before limits check.

while (actions[act].at != startAction && act < maxAction) {
    act++;
}

Discussion

  • Neil Hodgson

    Neil Hodgson - 2017-04-13

    This is actually safe due to the interaction of currentAction, maxAction, and lenActions. Changed anyway to silence Cppcheck with [99e46e].

    Cppcheck is quite buggy as it makes too many assumptions about the meaning of code. Unless a real problem can be demonstrated, Cppcheck warnings should be ignored.

     

    Related

    Commit: [99e46e]

  • Neil Hodgson

    Neil Hodgson - 2017-04-13
    • labels: --> scintilla
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB