Displaying test cases 26376 - 26400 of 45437 in total
-
CWE: 675 Duplicate Operations on Resource BadSource: freopen Open and close a file using freopen() and flose() GoodSource: Open a file using fopen() Sinks: GoodSink: Do nothing BadSink : Close the file Flow Variant: 52 Data flow: data passed as an argument from one function to another to an...
-
CWE: 606 Unchecked Input For Loop Condition BadSource: connect_socket Read data using a connect socket (client side) GoodSource: Input a number less than MAX_LOOP Sinks: GoodSink: Use data as the for loop variant after checking to see if it is less than MAX_LOOP BadSink : Use data as the for...
-
CWE: 590 Free Memory Not on 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: 03 Control flow: if(5==5) and if(5!=5)
-
CWE: 588 Attempt to Access Child of Non Structure Pointer BadSource: Void pointer to an int GoodSource: Void pointer to a twoints struct Sink: BadSink : Print data Flow Variant: 01 Baseline
-
CWE: 506 Embedded Malicious Code Sinks: listen_socket BadSink : Send file contents using a listen socket (server side) BadOnly (No GoodSink) Flow Variant: 16 Control flow: while(1)
-
CWE: 468 Incorrect Pointer Scaling Sinks: char_ptr_to_int GoodSink: Correctly use sizeof() for pointer scaling BadSink : Do not use sizeof() in pointer scaling Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 457 Use of Uninitialized Variable BadSource: no_init Dont initialize data GoodSource: Initialize data Sinks: use GoodSink: Initialize then use data BadSink : Use data Flow Variant: 02 Control flow: if(1) and if(0)
-
CWE: 426 Untrusted Search Path BadSource: Dont specify the full path in the OS command GoodSource: Specify the full path in the OS command Sinks: system BadSink : Execute the system function Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different so...
-
CWE: 398 Poor Code Quality Sinks: equals GoodSink: Set a variable equal to another variable BadSink : Setting a variable equal to itself has no effect Flow Variant: 16 Control flow: while(1)
-
CWE: 259 Use of Hard-coded Password BadSource: Use a hardcoded password GoodSource: Read the password from the console Sink: BadSink : Authenticate the user using LogonUserA() Flow Variant: 03 Control flow: if(5==5) and if(5!=5)
-
CWE: 252 Unchecked Return Value Sinks: sscanf GoodSink: Check if swscanf() fails BadSink : Do not check if swscanf() fails Flow Variant: 12 Control flow: if(globalReturnsTrueOrFalse())
-
CWE: 197 Numeric Truncation Error BadSource: large Set data to a number larger than SHRT_MAX GoodSource: Less than CHAR_MAX Sink: to_char BadSink : Convert data to a char Flow Variant: 32 Data flow using two pointers to the same value within the same function
-
CWE: 191 Integer Underflow BadSource: rand Set data to result of rand() GoodSource: Set data to a small, non-zero number (negative two) Sinks: multiply GoodSink: Ensure there will not be an underflow before multiplying data by 2 BadSink : If data is negative, multiply by 2, which can cause a...
-
CWE: 190 Integer Overflow BadSource: max Set data to the max value for int GoodSource: Set data to a small, non-zero number (two) Sinks: add GoodSink: Ensure there will not be an overflow before adding 1 to data BadSink : Add 1 to data, which can cause an overflow Flow Variant: 68 Data flow...
-
CWE: 190 Integer Overflow BadSource: fgets Read data from the console using fgets() GoodSource: Set data to a small, non-zero number (two) Sinks: multiply GoodSink: Ensure there will not be an overflow before multiplying data by 2 BadSink : If data is positive, multiply by 2, which can cause...
-
CWE: 134 Uncontrolled Format String BadSource: console Read input from the console GoodSource: Copy a fixed string into data Sinks: vfprintf GoodSink: vfprintf with a format string BadSink : vfprintf without a format string Flow Variant: 03 Control flow: if(5==5) and if(5!=5)
-
CWE: 134 Uncontrolled Format String BadSource: connect_socket Read data using a connect socket (client side) 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 Vari...
-
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: loop BadSink : Copy data to string using a loop Flow Variant: 67 Data flow: data passed in a struct from one function to another in...
-
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: loop BadSink : Copy data to string using a loop Flow Variant: 45 Data flow: data passed as a static global variable from one functi...
-
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: 10 Control flow: if(globalTrue) and if(globalFalse)
-
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 Sinks: ncat BadSink : Copy string to data using strncat Flow Variant: 65 Data/control flow: data passed as...
-
CWE: 121 Stack 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 strcat 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: ncat BadSink : Copy string to data using wcsncat Flow Variant: 09 Control flow: if(GLOBAL_CONST_TRUE) and if(GLOBAL_CONST_FALSE)
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sink: loop BadSink : Copy int64_t array to data using a loop Flow Variant: 04 Control flow: if(STATIC_CONST_TRUE) and if(STATIC_CONST_FALSE)
-
Buffer Overflow. This code has been donated by MIT. This test case has the following characteristics : write/read = Write, Which bound = Upper, Data type = character, Memory location = stack, Scope = same, Container = no, Pointer = no, Index complexity = constant, Address complexity = con...