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

4 lines
123 B
C++

bool checkOverflow(unsigned short x, unsigned short y) {
return ((unsigned short)(x + y) < x); // GOOD: explicit cast
}