SAMATE Logo NIST Logo The SAMATE Project Department of Homeland Security
Downloads:  Download this Test Case #252060

Back to the previous page... Back to the previous page

Test Case IDAccepted252060
Bad / Good / MixedMixedMixed test case
AuthorNSA/Center for Assured Software
Test suite: 109  
Added byCharles Oliveira
Type of test caseSource Code
Input string
Expected Output
Submission date2017-11-02
DescriptionCWE: 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: 08 Control flow: if(privateReturnsTrue()) and if(privateReturnsFalse())

There are no comments
Have any comments on this test case? Please, .

File Contains:
CWE-191: Integer Underflow (Wrap or Wraparound) on line(s): 42, 54