Deprecated test suite
Juliet C/C++ 1.0 with extra support Test suite #68
DownloadDescription
This is a collection of test cases in the C/C++ language. It contains examples for 116 different CWEs. NOTE: This package contains only individual test cases. We recommend to download the full test suite at the top of the "Test Suite" page. All documents related to the Juliet Test Suite can be found at the documents page
Displaying test cases 11401 - 11425 of 45309 in total
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory for a string, but do not allocate space for NULL terminator GoodSource: Allocate enough memory for a string and the NULL terminator Sink: ncpy BadSink : Copy string to data using strncpy() Flow Variant: 68 Data flow: d...
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 01 Baseline
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 03 Control flow: if(5==5) and if(5!=5)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 04 Control flow: if(static_const_t) and if(static_const_f)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 05 Control flow: if(static_t) and if(static_f)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 06 Control flow: if(static_const_five==5) and if(static_const_five!=5)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 07 Control flow: if(static_five==5) and if(static_five!=5)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 08 Control flow: if(static_returns_t()) and if(static_returns_f())
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 09 Control flow: if(global_const_t) and if(global_const_f)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 10 Control flow: if(global_t) and if(global_f)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 11 Control flow: if(global_returns_t()) and if(global_returns_f())
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 12 Control flow: if(global_returns_t_or_f())
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 13 Control flow: if(global_const_five==5) and if(global_const_five!=5)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 14 Control flow: if(global_five==5) and if(global_five!=5)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 15 Control flow: switch(6)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 16 Control flow: while(1) and while(0)
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 17 Control flow: for loops
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 18 Control flow: goto statements
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 19 Control flow: Dead code after a return
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sinks: loop BadSink : Copy array to data using a loop Flow Variant: 31 Data flow using a copy of data within the same function
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 32 Data flow using two pointers to the same value within the same function
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sinks: loop BadSink : Copy array to data using a loop Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data...
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 41 Data flow: data passed as an argument from one function to another in the sa...
-
CWE: 131 Incorrect Calculation of Buffer Size BadSource: Allocate memory without using sizeof(int) GoodSource: Allocate memory using sizeof(int) Sink: loop BadSink : Copy array to data using a loop Flow Variant: 42 Data flow: data returned from one function to another in the same source file