Skip to content

trunk/src/common/displayport/src/dp_configcaps.cpp:405: array index sanity check in wrong place ? #110

@dcb314

Description

@dcb314

Static analyser cppcheck says:

trunk/src/common/displayport/src/dp_configcaps.cpp:405:55: style: Array index 'i' is used before limits check. [arrayIndexThenCheck]

Source code is

               for (int i = 0; caps.linkRateTable[i] && (i < NV_DPCD_SUPPORTED_LINK_RATES__SIZE); i++)

Suggest move sanity check from after use, to before use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ImplementedFixed, in test prior to release integrationbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions