Files
codeql/cpp/ql/src/Critical/MissingNegativityTest.cpp
2018-11-07 11:32:17 -08:00

10 lines
276 B
C++

Record records[SIZE] = ...;
int f() {
int recordIdx = 0;
recordIdx = readUserInput(); //recordIdx is returned from a function
// there is no check so it could be negative
doFoo(&(records[recordIdx])); //but is not checked before use as an array offset
}