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

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

Test Case IDCandidate154647
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Associations
Test suite: 102  
Application: 16  
Added byCharles Oliveira
LanguageJava
Type of test caseSource Code
Input string
Expected Output
Instructions
See src/build.xml.
Submission date2015-10-06
DescriptionThis weakness takes an integer, two file names, and an integer "int file1 file2 int" as an input. The first integer is the size of the array to sort for timing in benign cases without FIFO files as inputs. The two files are used for thread "scheduling", if they are FIFO files in the order "fifo1 fifo2" with respect to the input script the weakness will occur, and if they are in reverse order the weakness will not occur. If the files are given as normal files, the weakness is dependent on the quicksort where a low quicksort value is nondeterministic and a larger value will increase the likelihood that the weakness will not occur. The final integer is the number of Fibonacci values to calculate and print. This weakness uses a singleton class to pass the Fibonacci values between the thread calculating them and the thread printing them. The method of instantiating a singleton used contains a race condition that can lead to multiple instances of the class being instantiated, leading to deadlock.
Metadata
- Base program: JTree
- Source Taint: FILE_CONTENTS
- Data Type: SIMPLE
- Data Flow: BASIC
- Control Flow: SEQUENCE
File(s)
Flaw

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

File Contains:
CWE-543: Use of Singleton Pattern Without Synchronization in a Multithreaded Context on line(s): 378, 379, 380