Files
codeql/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.cpp
2018-08-02 17:53:23 +01:00

8 lines
238 B
C++

typedef long long LONGLONG;
int f(unsigned int u, LONGLONG l) {
if(u > 0 || l >=0) //correct: unsigned value is check for > 0
return 23;
return u >= 0; //wrong: unsigned values are always greater than or equal to 0
}