National Institute of Standards and Technology
Package illustrating a test case

Test case 250552

Description

CWE: 191 Integer Underflow
BadSource: min Set data to the max value for byte
GoodSource: A hardcoded non-zero, non-min, non-max, even number
Sinks: sub
GoodSink: Ensure there will not be an underflow before subtracting 1 from data
BadSink : Subtract 1 from data, which can cause an Underflow
Flow Variant: 17 Control flow: for loops

Flaws

Test Suites

Documentation

    • CWE191_Integer_Underflow__byte_min_predec_17.javaline 33
      • CWE-191 Integer Underflow (Wrap or Wraparound)
    • CWE191_Integer_Underflow__byte_min_predec_17.javaline 38
      • CWE-191 Integer Underflow (Wrap or Wraparound)
src
main
java
testcases
CWE191_Integer_Underflow
s05
CWE191_Integer_Underflow__byte_min_predec_17.java
testcasesupport
AbstractTestCase.java
AbstractTestCaseBase.java
IO.java
manifest.sarif

Have any comments on this test case? Please, send us an email.