Displaying test cases 72376 - 72400 of 74755 in total
-
CWE: 758 Undefined Behavior Sinks: malloc_use GoodSink: Initialize then use data BadSink : Use data from malloc without initialization Flow Variant: 01 Baseline
-
CWE: 690 Unchecked Return Value To NULL Pointer BadSource: realloc Allocate data using realloc() 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...
-
CWE: 680 Integer Overflow to Buffer Overflow BadSource: rand Set data to result of rand(), which may be zero 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: 1...
-
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: 467 Use of sizeof() on a Pointer Type BadSource: Initialize the source buffer using the size of a pointer GoodSource: Initialize the source buffer using the size of the DataElementType Sinks: BadSink : Print then free data Flow Variant: 66 Data flow: data passed in an array from one fu...
-
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: 08 Control flow: if(static_returns_t()) and if(static_returns_f())
-
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: 03 Control flow: if(5==5) and if(5!=5)
-
CWE: 390 Detection of Error Condition Without Action Sinks: fgets GoodSink: Check if fgetws() failed and handle errors properly BadSink : Check to see if fgetws() failed, but do nothing about it Flow Variant: 18 Control flow: goto statements
-
CWE: 390 Detection of Error Condition Without Action Sinks: snprintf GoodSink: Check if snprintf() failed and handle errors properly BadSink : Check to see if snprintf() failed, but do nothing about it Flow Variant: 07 Control flow: if(static_five==5) and if(static_five!=5)
-
CWE: 36 Absolute Path Traversal BadSource: Environment Read input from an environment variable GoodSource: Full path and file name Sinks: open BadSink : Flow Variant: 67 Data flow: data passed in a struct from one function to another in different source files
-
CWE: 252 Unchecked Return Value Sinks: fputc GoodSink: Check if fputc() fails BadSink : Do not check if fputc() fails Flow Variant: 12 Control flow: if(global_returns_t_or_f())
-
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: 13 Control flow: if(global_const_five==5) and if(global_const_five!=5)
-
CWE: 23 Relative Path Traversal BadSource: fromFile Read input from a file GoodSource: File name without a period or slash Sink: fopen BadSink : Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all five functions are in different sourc...
-
CWE: 194 Unexpected Sign Extension BadSource: negative Set data to a fixed negative number GoodSource: Positive integer Sink: memcpy BadSink : Copy strings using memcpy() with the length of data Flow Variant: 09 Control flow: if(global_const_t) and if(global_const_f)
-
CWE: 190 Integer Overflow BadSource: fscanf Read data from the console using fscanf() GoodSource: Small, non-zero Sinks: square GoodSink: Ensure there is no overflow before performing the square root BadSink : Square data Flow Variant: 14 Control flow: if(global_five==5) and if(global_five!=5)
-
CWE: 190 Integer Overflow BadSource: fgets Read data from the console using fgets() GoodSource: Small, non-zero Sinks: add GoodSink: Ensure there is no overflow before performing the addition BadSink : Add 1 to data Flow Variant: 03 Control flow: if(5==5) and if(5!=5)
-
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: memcpy BadSink : Copy string to data using memcpy() Flow Variant: 42 Data flow: ...
-
CWE: 127 Buffer Under-read BadSource: Set data pointer to before the allocated memory buffer GoodSource: Set data pointer to the allocated memory buffer Sinks: memcpy BadSink : Copy data to string using memcpy Flow Variant: 63 Data flow: pointer to data passed from one function to another i...
-
CWE: 124 Buffer Underwrite BadSource: Set data pointer to before the allocated memory buffer GoodSource: Set data pointer to the allocated memory buffer Sink: memmove BadSink : Copy string to data using memmove Flow Variant: 42 Data flow: data returned from one function to another in the sa...
-
CWE: 124 Buffer Underwrite BadSource: Set data pointer to before the allocated memory buffer GoodSource: Set data pointer to the allocated memory buffer Sink: memmove BadSink : Copy string to data using memmove 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 Sink: loop BadSink : Copy data to string using a loop Flow Variant: 41 Data flow: data passed as an argument from one function to another in the same source file
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sink: memcpy BadSink : Copy string to data using memcpy Flow Variant: 09 Control flow: if(global_const_t) and if(global_const_f)
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sinks: cat BadSink : Copy string to data using strcat Flow Variant: 65 Data/control flow: data passed as an argument from one function to a function in a differ...
-
CWE: 121 Stack Based Buffer Overflow Sinks: type_overrun_memcpy GoodSink: Perform the memcpy() and prevent overwriting part of the structure BadSink : Overwrite part of the structure by incorrectly using the sizeof(struct) in memcpy() Flow Variant: 15 Control flow: switch(6)
-
CWE: 114 Process Control BadSource: fromFile Read input from a file GoodSource: Hard code the full pathname to the library Sink: BadSink : Load a dynamic link library Flow Variant: 68 Data flow: data passed as a global variable from one function to another in different source files