Displaying test cases 28501 - 28525 of 45437 in total
-
CWE: 690 Unchecked Return Value To NULL Pointer BadSource: malloc Allocate data using malloc() Sinks: GoodSink: Check to see if the data allocation failed and if not, use data BadSink : Dont check for NULL and use data Flow Variant: 07 Control flow: if(staticFive==5) and if(staticFive!=5)
-
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 : Dont check for NULL and use data Flow Variant: 51 Data flow: data passed as an argument from one function ...
-
CWE: 606 Unchecked Input For Loop Condition BadSource: file Read input from a file 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 loop variant without checking its...
-
CWE: 606 Unchecked Input For Loop Condition BadSource: listen_socket Read data using a listen socket (server 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 l...
-
CWE: 563 Unused Variable BadSource: Initialize data Sinks: GoodSink: Initialize, then use data BadSink : Do nothing Flow Variant: 09 Control flow: if(GLOBAL_CONST_TRUE) and if(GLOBAL_CONST_FALSE)
-
CWE: 546 Suspicious Comment Sinks: HACK GoodSink: Comments show no indications of hacks BadSink : Comment contains the word HACK Flow Variant: 18 Control flow: goto statements
-
CWE: 398 Poor Code Quality Sinks: empty_if GoodSink: If statement contains code BadSink : An empty if statement has no effect Flow Variant: 12 Control flow: if(globalReturnsTrueOrFalse())
-
CWE: 398 Poor Code Quality Sinks: empty_block GoodSink: Code block contains code BadSink : An empty code block has no effect Flow Variant: 04 Control flow: if(STATIC_CONST_TRUE) and if(STATIC_CONST_FALSE)
-
CWE: 369 Divide by Zero BadSource: fscanf Read data from the console using fscanf() GoodSource: Non-zero Sinks: modulo GoodSink: Check for zero before modulo BadSink : Modulo a constant with data Flow Variant: 66 Data flow: data passed in an array from one function to another in different s...
-
CWE: 369 Divide by Zero BadSource: connect_socket Read data using a connect socket (client side) GoodSource: A hardcoded non-zero number (two) Sinks: GoodSink: Check value of or near zero before dividing BadSink : Divide a constant by data Flow Variant: 16 Control flow: while(1)
-
CWE: 252 Unchecked Return Value Sinks: scanf GoodSink: Check if wscanf() fails BadSink : Do not check if wscanf() fails Flow Variant: 05 Control flow: if(staticTrue) and if(staticFalse)
-
CWE: 252 Unchecked Return Value Sinks: rename GoodSink: Check if rename() fails BadSink : Do not check if rename() fails Flow Variant: 05 Control flow: if(staticTrue) and if(staticFalse)
-
CWE: 197 Numeric Truncation Error BadSource: fgets Read data from the console using fgets() GoodSource: Less than CHAR_MAX Sinks: to_char BadSink : Convert data to a char Flow Variant: 61 Data flow: data returned from one function to another in different source files
-
CWE: 197 Numeric Truncation Error BadSource: connect_socket Read data using a connect socket (client side) GoodSource: Less than CHAR_MAX Sink: to_char BadSink : Convert data to a char Flow Variant: 08 Control flow: if(staticReturnsTrue()) and if(staticReturnsFalse())
-
CWE: 195 Signed to Unsigned Conversion Error BadSource: negative Set data to a fixed negative number GoodSource: Positive integer Sinks: strncpy BadSink : Copy strings using strncpy() with the length of data Flow Variant: 67 Data flow: data passed in a struct from one function to another in ...
-
CWE: 195 Signed to Unsigned Conversion Error BadSource: fscanf Read data from the console using fscanf() GoodSource: Positive integer Sink: strncpy BadSink : Copy strings using strncpy() with the length of data Flow Variant: 10 Control flow: if(globalTrue) and if(globalFalse)
-
CWE: 190 Integer Overflow BadSource: fgets Read data from the console using fgets() 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: 01 ...
-
CWE: 134 Uncontrolled Format String BadSource: environment Read input from an environment variable GoodSource: Copy a fixed string into data Sinks: vprintf GoodSink: vwprintf with a format string BadSink : vwprintf without a format string Flow Variant: 04 Control flow: if(STATIC_CONST_TRUE)...
-
CWE: 134 Uncontrolled Format String BadSource: console Read input from the console GoodSource: Copy a fixed string into data Sinks: vprintf GoodSink: vwprintf with a format string BadSink : vwprintf without a format string Flow Variant: 64 Data flow: void pointer to data passed from one fun...
-
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: wprintf with %s as the first argument and data as the second BadSink : wprintf with only data as an argument Flow Va...
-
CWE: 134 Uncontrolled Format String BadSource: file Read input from a file 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: 05 Control flow: if(staticTru...
-
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: ncpy BadSink : Copy data to string using wcsncpy Flow Variant: 53 Data flow: data passed as an argument from one function through tw...
-
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: 01 Baseline
-
CWE: 121 Stack Based Buffer Overflow BadSource: Initialize data as a large string GoodSource: Initialize data as a small string Sink: memcpy BadSink : Copy data to string using memcpy Flow Variant: 10 Control flow: if(globalTrue) and if(globalFalse)
-
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 = variable, Address complexity = con...