National Institute of Standards and Technology
Package illustrating a test case

Test case 252111

Description

CWE: 191 Integer Underflow
BadSource: rand Set data to result of rand()
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: 42 Data flow: data returned from one method to another in the same class

Flaws

Test Suites

Documentation

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