Displaying test cases 74001 - 74025 of 74755 in total
-
CWE: 680 Integer Overflow to Buffer Overflow BadSource: fscanf Read data from the console using fscanf() GoodSource: Small number greater than zero that will not cause an integer overflow in the sink Sink: BadSink : Attempt to allocate array using length value from source Flow Variant: 05 Co...
-
CWE: 675 Duplicate Operations on Resource BadSource: Open and close a file using open() and close() GoodSource: Open a file using open() Sinks: GoodSink: Do nothing BadSink : Close the file Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 590 Free of Invalid Pointer Not on the Heap BadSource: declare Data buffer is declared on the stack GoodSource: Allocate memory on the heap Sinks: BadSink : Print then free data Flow Variant: 65 Data/control flow: data passed as an argument from one function to a function in a different...
-
CWE: 590 Free of Invalid Pointer Not on the Heap BadSource: declare Data buffer is declared on the stack GoodSource: Allocate memory on the heap Sink: BadSink : Print then free data Flow Variant: 06 Control flow: if(static_const_five==5) and if(static_const_five!=5)
-
CWE: 459 Incomplete Cleanup Sinks: GoodSink: Clean up properly BadSink : Don't unlink Flow Variant: 16 Control flow: while(1) and while(0)
-
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: 45 Data flow: data passed as a sta...
-
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: 18 Control flow: goto statements
-
CWE: 404 Improper Resource Shutdown or Release BadSource: Open a file using CreateFile() Sinks: close GoodSink: Close the file using CloseHandle() BadSink : Close the file using close() Flow Variant: 11 Control flow: if(global_returns_t()) and if(global_returns_f())
-
CWE: 404 Improper Resource Shutdown or Release BadSource: freopen Open a file using freopen() Sinks: w32CloseHandle GoodSink: Close the file using fclose() BadSink : Close the file using CloseHandle Flow Variant: 04 Control flow: if(static_const_t) and if(static_const_f)
-
CWE: 401 Memory Leak BadSource: Allocate data using new[] GoodSource: Point data to a stack buffer Sinks: GoodSink: call delete[] on data BadSink : no deallocation of data Flow Variant: 43 Data flow: data flows using a C++ reference from one function to another in the same source file
-
CWE: 401 Memory Leak Sinks: GoodSink: Ensure the memory block pointed to by data is always freed BadSink : malloc() and use then realloc() and use data before free() Flow Variant: 05 Control flow: if(static_t) and if(static_f)
-
CWE: 226 Sensitive Information Uncleared Before Release Sinks: w32declare GoodSink: Clear the password buffer before releasing the memory from the stack BadSink : Release password from the stack without first clearing the buffer Flow Variant: 06 Control flow: if(static_const_five==5) and if(s...
-
CWE: 195 Signed to Unsigned Conversion BadSource: listen_socket Read data using a listen socket (server side) GoodSource: Positive integer Sinks: memcpy BadSink : Copy strings using memcpy() with the length of data Flow Variant: 66 Data flow: data passed in an array from one function to anot...
-
CWE: 191 Integer Underflow BadSource: fixed Fixed value GoodSource: Small, non-zero Sinks: GoodSink: Ensure there is no underflow before performing the subtraction BadSink : Subtract 1 from data Flow Variant: 51 Data flow: data passed as an argument from one function to another in different...
-
CWE: 190 Integer Overflow BadSource: fscanf Read data from the console using fscanf() GoodSource: Small, non-zero Sinks: add GoodSink: Ensure there is no overflow before performing the addition BadSink : Add 1 to data Flow Variant: 34 Data flow: use of a union containing two methods of acce...
-
CWE: 134 Uncontrolled Format String BadSource: Environment Read input from an environment variable GoodSource: Copy a fixed string into data Sinks: vsnprintf GoodSink: vsnprintf with a format string BadSink : vsnprintf without a format string Flow Variant: 65 Data/control flow: data passed ...
-
CWE: 126 Buffer Over-read BadSource: Use a small buffer GoodSource: Use a large buffer Sink: loop BadSink : Copy data to string using a loop Flow Variant: 52 Data flow: data passed as an argument from one function to another to another in three 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: loop BadSink : Copy string to data using a loop Flow Variant: 05 Control flow: if(static_t) and if(static_f)
-
CWE: 122 Heap Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sinks: snprintf BadSink : Copy data to string using snwprintf Flow Variant: 63 Data flow: pointer to data passed from one function to another in different source files
-
CWE: 122 Heap Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sink: cat BadSink : Copy data to string using wcscat Flow Variant: 07 Control flow: if(static_five==5) and if(static_five!=5)
-
CWE: 122 Heap Based Buffer Overflow BadSource: Allocate using malloc() and set data pointer to a small buffer GoodSource: Allocate using malloc() and set data pointer to a large buffer Sink: memcpy BadSink : Copy int array to data using memcpy Flow Variant: 52 Data flow: data passed as an a...
-
CWE: 121 Stack Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sinks: ncpy BadSink : Copy data to string using strncpy Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data (within the sa...
-
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: 04 Control flow: if(static_const_t) and if(static_const_f)
-
CWE: 114 Process Control BadSource: connect_socket Read data using a connect socket (client side) GoodSource: Hard code the full pathname to the library Sinks: BadSink : Load a dynamic link library Flow Variant: 67 Data flow: data passed in a struct from one function to another in different ...
-
CWE: 114 Process Control BadSource: connect_socket Read data using a connect socket (client side) GoodSource: Hard code the full pathname to the library Sink: BadSink : Load a dynamic link library Flow Variant: 53 Data flow: data passed as an argument from one function through two others to ...