From `The CERT Oracle Secure Coding Standard for Java`
public static int safeAdd(int l, int r) throws OverflowException
{
if (r > 0
? l > Integer.MAX_VALUE - r
: l < Integer.MIN_VALUE - r)
throw new ArithmeticException(String.format(
"Integer overflow: %d + %d", l, r));
return l + r;
There is checkio.org for Pythonistas. As I know, there is no language choice for now but there will be on the future.It motivates coders with gamification and also level of problems.
public static int safeAdd(int l, int r) throws OverflowException {
}
https://www.securecoding.cert.org/confluence/display/java/NU...