Files
codeql/cpp/ql/src/experimental/Likely Bugs/RedundantNullCheckParam.cpp
Philippe Antoine 06c8a0bf20 move to experimental
2020-07-09 16:09:57 +02:00

12 lines
243 B
C++

void test(char *arg1, int *arg2) {
if (arg1[0] == 'A') {
if (arg2 != NULL) { //maybe redundant
*arg2 = 42;
}
}
if (arg1[1] == 'B')
{
*arg2 = 54; //dereferenced without checking first
}
}