Displaying test cases 74001 - 74025 of 74755 in total
-
CWE: 762 Mismatched Memory Management Routines BadSource: Allocate data using new GoodSource: Allocate data using malloc() Sinks: GoodSink: Deallocate data using delete BadSink : Deallocate data using free() Flow Variant: 33 Data flow: use of a C++ reference to data within the same function
-
CWE: 762 Mismatched Memory Management Routines BadSource: Allocate data using new [] GoodSource: Allocate data using new Sinks: GoodSink: Deallocate data using delete [] BadSink : Deallocate data using delete Flow Variant: 08 Control flow: if(static_returns_t()) and if(static_returns_f())
-
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: 41 Data flow: data passed as an argument from one function to another in the same ...
-
CWE: 563 Unused Variable BadSource: Initialize data GoodSource: Initialize and use data Sinks: GoodSink: Use data BadSink : Initialize and use data Flow Variant: 16 Control flow: while(1) and while(0)
-
CWE: 476 NULL Pointer Dereference BadSource: Set data to NULL GoodSource: Initialize data Sink: BadSink : Print data Flow Variant: 41 Data flow: data passed as an argument from one function to another in the same source file
-
CWE: 416 Use After Free BadSource: Allocate data using new, initialize memory block, and Deallocate data using delete GoodSource: Allocate data using new and initialize memory block Sinks: GoodSink: Do nothing BadSink : Use data after free() Flow Variant: 03 Control flow: if(5==5) and if(5...
-
CWE: 404 Improper Resource Shutdown or Release BadSource: Open a file using open() Sinks: w32CloseHandle GoodSink: Close the file using close() BadSink : Close the file using CloseHandle Flow Variant: 10 Control flow: if(global_t) and if(global_f)
-
CWE: 401 Memory Leak BadSource: realloc Allocate data using realloc() GoodSource: Allocate data on the stack Sinks: GoodSink: call free() on data BadSink : no deallocation of data Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data (within the same f...
-
CWE: 36 Absolute Path Traversal BadSource: fromConsole Read input from the console GoodSource: Full path and file name Sink: fopen BadSink : Flow Variant: 08 Control flow: if(static_returns_t()) and if(static_returns_f())
-
CWE: 284 Access Control Issues Sinks: w32CreateFile GoodSink: Create a file using CreateFileW() without excessive privileges BadSink : Create a file using CreateFileW() with excessive privileges Flow Variant: 12 Control flow: if(global_returns_t_or_f())
-
CWE: 23 Relative Path Traversal BadSource: connect_socket Read data using a connect socket (client side) GoodSource: File name without a period or slash Sink: fopen BadSink : Flow Variant: 10 Control flow: if(global_t) and if(global_f)
-
CWE: 195 Signed to Unsigned Conversion BadSource: listen_socket Read data using a listen socket (server side) GoodSource: Positive integer Sinks: malloc BadSink : Allocate memory using malloc() with the size of data Flow Variant: 65 Data/control flow: data passed as an argument from one func...
-
CWE: 195 Signed to Unsigned Conversion BadSource: fscanf Read data from the console using fscanf() GoodSource: Positive integer Sink: memcpy BadSink : Copy strings using memcpy() with the length of data Flow Variant: 08 Control flow: if(static_returns_t()) and if(static_returns_f())
-
CWE: 187 Partial Comparison BadSource: fromConsole Read input from the console GoodSource: Provide a matching password Sinks: ncmp_user_pw GoodSink: Compare the 2 passwords correctly BadSink : use wcsncmp() to do password match, but use the length of the user password Flow Variant: 45 Data ...
-
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 wcsncpy() Flow Variant: 07 Control flow...
-
CWE: 129 Improper Validation of Array Index BadSource: rand Set data to result of rand(), which may be zero GoodSource: Larger than zero but less than 10 Sinks: int GoodSink: Ensure the array index is valid BadSink : Improperly check the array index by not checking the upper bound Flow Vari...
-
CWE: 129 Improper Validation of Array Index BadSource: fgets Read data from the console using fgets() GoodSource: Larger than zero but less than 10 Sinks: int GoodSink: Ensure the array index is valid BadSink : Improperly check the array index by not checking the upper bound Flow Variant: 0...
-
CWE: 127 Buffer Under-read BadSource: Set data pointer to before the allocated memory buffer GoodSource: Set data pointer to the allocated memory buffer Sink: cpy BadSink : Copy data to string using wcscpy Flow Variant: 14 Control flow: if(global_five==5) and if(global_five!=5)
-
CWE: 124 Buffer Underwrite BadSource: Set data pointer to before the allocated memory buffer GoodSource: Set data pointer to the allocated memory buffer Sink: ncpy BadSink : Copy string to data using strncpy Flow Variant: 10 Control flow: if(global_t) and if(global_f)
-
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 int array to data using a loop Flow Variant: 16 Control flow: while(1) and while(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 Sinks: memcpy BadSink : Copy string to data using memcpy Flow Variant: 31 Data flow using a copy of data within ...
-
CWE: 122 Heap Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sink: ncpy BadSink : Copy data to string using wcsncpy Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all...
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sinks: memmove BadSink : Copy string to data using memmove Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data (within ...
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sink: memmove BadSink : Copy twoints array to data using memmove Flow Variant: 19 Control flow: Dead code after a return
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sink: memmove BadSink : Copy int array to data using memmove Flow Variant: 14 Control flow: if(global_five==5) and if(global_five!=5)