Displaying test cases 72976 - 73000 of 74755 in total
-
CWE: 762 Mismatched Memory Management Routines BadSource: calloc Allocate data using calloc() GoodSource: Allocate data using new [] Sinks: GoodSink: Deallocate data using free() BadSink : Deallocate data using delete [] Flow Variant: 43 Data flow: data flows using a C++ reference from one ...
-
CWE: 690 Unchecked Return Value To NULL Pointer BadSource: calloc Allocate data using calloc() Sinks: GoodSink: Check to see if the data allocation failed and if not, use data BadSink : Don't check for NULL and use data Flow Variant: 42 Data flow: data returned from one function to another i...
-
CWE: 590 Free of Invalid Pointer Not on the Heap BadSource: static Data buffer is declared static on the stack GoodSource: Allocate memory on the heap Sink: BadSink : Print then free data Flow Variant: 68 Data flow: data passed as a global variable from one function to another in different s...
-
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: 54 Data flow: data passed as an argument from one function through three others to a fifth; all ...
-
CWE: 469 Use Of Pointer Subtraction To Determine Size Sinks: ncpy GoodSink: using correct pointer subtraction to determine length in strncpy() BadSink : Beginning and end pointers are switched leading to an incorrect length in strncpy() Flow Variant: 06 Control flow: if(static_const_five==5) ...
-
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: 11 Control flow: if(global_returns_t(...
-
CWE: 401 Memory Leak BadSource: calloc Allocate data using calloc() GoodSource: Allocate data on the stack Sinks: GoodSink: call free() on data BadSink : no deallocation of data Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 253 Incorrect Check of Return Value Sinks: putchar GoodSink: Correctly check if putchar() failed BadSink : Incorrectly check if putchar() failed Flow Variant: 03 Control flow: if(5==5) and if(5!=5)
-
CWE: 253 Incorrect Check of Return Value Sinks: fgets GoodSink: Correctly check if fgets() failed before trying to use the destination buffer BadSink : Incorrectly check if fgets() failed Flow Variant: 18 Control flow: goto statements
-
CWE: 252 Unchecked Return Value Sinks: fputc GoodSink: Check if fputwc() fails BadSink : Do not check if fputwc() fails Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 247 Reliance on DNS Lookups in a Security Decision Sinks: GoodSink: Log host name without using it in a security decision BadSink : Use the reverse DNS of the client to determine whether to allow the connection Flow Variant: 18 Control flow: goto statements
-
CWE: 23 Relative Path Traversal BadSource: fromConsole Read input from the console GoodSource: File name without a period or slash Sinks: open BadSink : Flow Variant: 61 Data flow: data returned from one function to another in different source files
-
CWE: 23 Relative Path Traversal BadSource: listen_socket Read data using a listen socket (server side) GoodSource: File name without a period or slash Sink: open BadSink : Flow Variant: 06 Control flow: if(static_const_five==5) and if(static_const_five!=5)
-
CWE: 195 Signed to Unsigned Conversion BadSource: listen_socket Read data using a listen socket (server side) GoodSource: Positive integer Sink: memmove BadSink : Copy strings using memmove() with the length of data Flow Variant: 05 Control flow: if(static_t) and if(static_f)
-
CWE: 170 Improper Null Termination Sinks: loop GoodSink: Copy a string using a loop with explicit null termination BadSink : Copy a string using a loop without explicit null termination Flow Variant: 15 Control flow: switch(6)
-
CWE: 134 Uncontrolled Format String BadSource: fromConsole Read input from the console GoodSource: Copy a fixed string into data Sinks: printf GoodSink: printf with "%s" as the first argument and data as the second BadSink : printf with only data as an argument Flow Variant: 52 Data flow: d...
-
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: char GoodSink: Ensure the array index is valid BadSink : Improperly check the array index by not checking the upper bound Flow Var...
-
CWE: 126 Buffer Over-read BadSource: Use a small buffer GoodSource: Use a large buffer Sinks: memcpy BadSink : Copy data to string using memcpy Flow Variant: 63 Data flow: pointer to data passed 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: loop BadSink : Copy string to data using a loop Flow Variant: 04 Control flow: if(static_const_t) and if(static_const_f)
-
CWE: 124 Buffer Underwrite BadSource: Set data pointer to before the allocated memory buffer GoodSource: Set data pointer to the allocated memory buffer Sink: cpy BadSink : Copy string to data using wcscpy Flow Variant: 04 Control flow: if(static_const_t) and if(static_const_f)
-
CWE: 124 Buffer Underwrite BadSource: Set data pointer to before the allocated memory buffer GoodSource: Set data pointer to the allocated memory buffer Sinks: ncpy BadSink : Copy string to data using strncpy Flow Variant: 66 Data flow: data passed in an array from one function to another i...
-
CWE: 122 Heap Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sink: snprintf BadSink : Copy data to string using snprintf Flow Variant: 13 Control flow: if(global_const_five==5) and if(global_const_five!=5)
-
CWE: 122 Heap Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sink: cpy BadSink : Copy data to string using strcpy 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 string to data using memcpy Flow Variant: 11 Control flow: if(global_returns_t...
-
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: 03 Control flow: if(5==5) and if(5!=5)