Displaying test cases 73826 - 73850 of 74755 in total
-
CWE: 617 Reachable Assertion BadSource: fixed Fixed value less than the assert value GoodSource: Number greater than ASSERT_VALUE Sinks: BadSink : Assert if n is less than ASSERT_VALUE Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data (within the sa...
-
CWE: 590 Free of Invalid Pointer Not on the Heap BadSource: alloca Data buffer is allocated on the stack with alloca() GoodSource: Allocate memory on the heap Sink: BadSink : Print then free data Flow Variant: 01 Baseline
-
CWE: 416 Use After Free BadSource: Allocate data using malloc(), initialize memory block, and Deallocate data using free() GoodSource: Allocate data using malloc() and initialize memory block Sinks: GoodSink: Do nothing BadSink : Use data Flow Variant: 44 Data/control flow: data passed as ...
-
CWE: 401 Memory Leak BadSource: malloc Allocate data using malloc() GoodSource: Allocate data on the stack Sinks: GoodSink: call free() on data BadSink : no deallocation of data Flow Variant: 03 Control flow: if(5==5) and if(5!=5)
-
CWE: 401 Memory Leak BadSource: malloc Allocate data using malloc() GoodSource: Allocate data on the stack Sinks: GoodSink: call free() on data BadSink : no deallocation of data Flow Variant: 67 Data flow: data passed in a struct from one function to another in different source files
-
CWE: 400 Resource Exhaustion BadSource: connect_socket Read data using a connect socket (client side) GoodSource: Assign count to be a relatively small number Sinks: for_loop GoodSink: Validate count before using it as the loop variant in a for loop BadSink : Use count as the loop variant in...
-
CWE: 390 Detection of Error Condition Without Action Sinks: remove GoodSink: Check if wremove() failed and handle errors properly BadSink : Check to see if remove() failed, but do nothing about it Flow Variant: 05 Control flow: if(static_t) and if(static_f)
-
CWE: 36 Absolute Path Traversal BadSource: listen_socket Read data using a listen socket (server side) GoodSource: Full path and file name Sink: open BadSink : Flow Variant: 10 Control flow: if(global_t) and if(global_f)
-
CWE: 369 Divide By Zero BadSource: zero Fixed value of zero GoodSource: Non-zero Sink: divide BadSink : Divide a constant by data Flow Variant: 06 Control flow: if(static_const_five==5) and if(static_const_five!=5)
-
CWE: 253 Incorrect Check of Return Value Sinks: w32CreateNamedPipe GoodSink: Correctly check if CreateNamedPipeW() failed BadSink : Incorrectly check if CreateNamedPipeW() failed Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 252 Unchecked Return Value Sinks: putchar GoodSink: Check if putwchar() fails BadSink : Do not check if putwchar() fails Flow Variant: 10 Control flow: if(global_t) and if(global_f)
-
CWE: 252 Unchecked Return Value Sinks: sscanf GoodSink: Check if sscanf() fails BadSink : Do not check if sscanf() fails Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 194 Unexpected Sign Extension BadSource: fgets Read data from the console using fgets() GoodSource: Positive integer Sinks: malloc BadSink : Allocate memory using malloc() with the size of data Flow Variant: 31 Data flow using a copy of data within the same function
-
CWE: 187 Partial Comparison BadSource: substring Provide a password that is a shortened version of the actual password GoodSource: Provide a matching password Sinks: ncmp_correct_pw GoodSink: Compare the 2 passwords correctly BadSink : use wcsncmp() to do password match, but use the length o...
-
CWE: 134 Uncontrolled Format String BadSource: fromFile Read input from a file GoodSource: Copy a fixed string into data Sinks: vprintf GoodSink: vprintf with a format string BadSink : vprintf without a format string Flow Variant: 05 Control flow: if(static_t) and if(static_f)
-
CWE: 126 Buffer Over-read BadSource: Set data pointer to a small buffer GoodSource: Set data pointer to a large buffer Sinks: memcpy BadSink : Copy data to string using memcpy Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data (within the same funct...
-
CWE: 126 Buffer Over-read BadSource: Set data pointer to a small buffer GoodSource: Set data pointer to a large buffer Sink: memcpy BadSink : Copy data to string using memcpy Flow Variant: 68 Data flow: data passed as a global variable from one function to another in different source files
-
CWE: 124 Buffer Underwrite BadSource: Set data pointer to before the allocated memory buffer GoodSource: Set data pointer to the allocated memory buffer Sink: memcpy BadSink : Copy string to data using memcpy Flow Variant: 41 Data flow: data passed as an argument from one function to anothe...
-
CWE: 122 Heap Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sinks: loop BadSink : Copy data to string using a loop Flow Variant: 61 Data flow: data returned from one function to another in different source files
-
CWE: 122 Heap Based Buffer Overflow BadSource: Allocate using new[] and set data pointer to a small buffer GoodSource: Allocate using new[] and set data pointer to a large buffer Sink: loop BadSink : Copy string to data using a loop Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 122 Heap Based Buffer Overflow BadSource: Allocate using new[] and set data pointer to a small buffer GoodSource: Allocate using new[] and set data pointer to a large buffer Sink: memcpy BadSink : Copy int array to data using memcpy Flow Variant: 07 Control flow: if(static_five==5) and...
-
CWE: 122 Heap Based Buffer Overflow Sinks: type_overrun_memmove GoodSink: Perform the memmove() and prevent overwriting part of the structure BadSink : Overwrite part of the structure by incorrectly using the sizeof(struct) in memmove() Flow Variant: 05 Control flow: if(static_t) and if(stati...
-
CWE: 121 Stack Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sink: memmove BadSink : Copy data to string using memmove Flow Variant: 05 Control flow: if(static_t) and if(static_f)
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sinks: loop BadSink : Copy twoints array to data using a loop Flow Variant: 44 Data/control flow: data passed as an argument from one function to a function in ...
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sink: snprintf BadSink : Copy string to data using snprintf Flow Variant: 19 Control flow: Dead code after a return