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

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

Test Case IDCandidate154364
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Test suite: 102  
Application: 16  
Added byCharles Oliveira
Type of test caseSource Code
Input string
Expected Output
See src/build.xml.
Submission date2015-10-06
DescriptionThis weakness takes an integer and string as input (int string) where the integer is the size of the array to sort for timing and the string is the data that is acted upon. The weakness spawns two threads, both of which in turn call the function 'arrFunc' which is non-reentrant. 'arrFunc' uses a static integer to iterate through the string which can lead to multiple increments of j per iteration of the for loop causing a StringIndexOutOfBoundsException if 'arrFunc' is run simultaneously by two or more threads.

- Base program: JTree
- Data Type: SIMPLE
- Data Flow: BASIC
- Control Flow: SEQUENCE

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

File Contains:
CWE-663: Use of a Non-reentrant Function in a Concurrent Context on line(s): 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268