Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tool
Version
Checker
Description
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V

JAVA.MATH.ABSRAND
JAVA.ARITH.OFLOW

Abs on random (Java)
Cast: int Computation to long (Java)

Coverity7.5

BAD_SHIFT
OVERFLOW_BEFORE_WIDEN

Implemented
Parasoft Jtest
Include Page
Parasoft_V
Parasoft_V
CERT.NUM00.ICO
CERT.NUM00.BSA
CERT.NUM00.CACO
Avoid calculations which result in overflow or NaN
Do not use an integer outside the range of [0, 31] as the amount of a shift
Avoid using compound assignment operators in cases which may cause overflow
PVS-Studio

Include Page
PVS-Studio_V
PVS-Studio_V

V5308, V6117

Related Guidelines

SEI CERT C Coding Standard

INT32-C. Ensure that operations on signed integers do not result in overflow

ISO/IEC TR 24772:2010

Wrap-around Error [XYY]

MITRE CWE

CWE-682, Incorrect Calculation
CWE-190, Integer Overflow or Wraparound
CWE-191, Integer Underflow (Wrap or Wraparound)

...