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

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

Test Case IDAccepted252110
Bad / Good / MixedMixedMixed test case
AuthorNSA/Center for Assured Software
Associations
Test suite: 109  
Added byCharles Oliveira
LanguageJava
Type of test caseSource Code
Input stringN/A
Expected OutputN/A
InstructionsN/A
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: 41 Data flow: data passed as an argument from one method to another in the same class
File(s)
Flaw

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


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