Displaying test cases 13876 - 13900 of 45437 in total
-
CWE: 134 Uncontrolled Format String BadSource: environment Read input from an environment variable GoodSource: Copy a fixed string into data Sinks: snprintf GoodSink: snwprintf with %s as the third argument and data as the fourth BadSink : snwprintf with data as the third argument Flow Vari...
-
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 twoIntsStruct array to data using memcpy Flow Variant: 15 Control flow: switch(6)
-
CWE: 90 LDAP Injection BadSource: console Read input from the console GoodSource: Use a fixed string Sinks: BadSink : data concatenated into LDAP search, which could result in LDAP Injection Flow Variant: 61 Data flow: data returned from one function to another in different source files
-
CWE: 90 LDAP Injection BadSource: environment Read input from an environment variable GoodSource: Use a fixed string Sink: BadSink : data concatenated into LDAP search, which could result in LDAP Injection Flow Variant: 21 Control flow: Flow controlled by value of a static global variable. A...
-
CWE: 773 Missing Reference to Active File Descriptor or Handle BadSource: Create a file handle using fopen() Sinks: GoodSink: Close the file handle before reusing it BadSink : Reassign the file handle before closing it Flow Variant: 51 Data flow: data passed as an argument from one function...
-
CWE: 666 Operation on Resource in Wrong Phase of Lifetime Sinks: bind_accept_listen GoodSink: Create a listen socket correctly by placing bind(), listen(), and accept() in the correct order BadSink : Attempt to bind(), accept(), then listen() Flow Variant: 08 Control flow: if(staticReturnsTru...
-
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: 427 Uncontrolled Search Path Element BadSource: environment Read input from an environment variable GoodSource: Use a hardcoded path Sink: BadSink : Set the environment variable Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all...
-
CWE: 284 Improper Access Control Sinks: CreateFile GoodSink: Create a file using CreateFileA() without excessive privileges BadSink : Create a file using CreateFileA() with excessive privileges Flow Variant: 12 Control flow: if(globalReturnsTrueOrFalse())
-
CWE: 252 Unchecked Return Value Sinks: fprintf GoodSink: Check if fwprintf() fails BadSink : Do not check if fwprintf() fails Flow Variant: 11 Control flow: if(globalReturnsTrue()) and if(globalReturnsFalse())
-
CWE: 252 Unchecked Return Value Sinks: remove GoodSink: Check if remove() fails BadSink : Do not check if remove() fails Flow Variant: 16 Control flow: while(1)
-
CWE: 197 Numeric Truncation Error BadSource: rand Set data to result of rand(), which may be zero GoodSource: Less than CHAR_MAX Sink: to_char BadSink : Convert data to a char Flow Variant: 52 Data flow: data passed as an argument from one function to another to another in three different so...
-
CWE: 197 Numeric Truncation Error BadSource: fgets Read data from the console using fgets() GoodSource: Less than CHAR_MAX Sink: to_char BadSink : Convert data to a char Flow Variant: 07 Control flow: if(staticFive==5) and if(staticFive!=5)
-
CWE: 194 Unexpected Sign Extension 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: 08 Control flow: if(staticReturnsTrue()) and if(staticReturnsFalse())
-
CWE: 191 Integer Underflow BadSource: min Set data to the minimum value for int 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...
-
CWE: 191 Integer Underflow BadSource: fgets Read data from the console using fgets() GoodSource: Set data to a small, non-zero number (negative two) Sinks: sub GoodSink: Ensure there will not be an underflow before subtracting 1 from data BadSink : Subtract 1 from data, which can cause an Un...
-
CWE: 190 Integer Overflow BadSource: fscanf Read data from the console using fscanf() 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 cau...
-
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: 190 Integer Overflow BadSource: rand Set data to result of rand() 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 Baseline
-
CWE: 15 External Control of System or Configuration Setting BadSource: Get the hostname from a network socket GoodSource: Get the hostname from a string literal Sink: BadSink : Set the hostname Flow Variant: 09 Control flow: if(GLOBAL_CONST_TRUE) and if(GLOBAL_CONST_FALSE)
-
CWE: 134 Uncontrolled Format String BadSource: listen_socket Read data using a listen socket (server 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 Vari...
-
CWE: 134 Uncontrolled Format String BadSource: listen_socket Read data using a listen socket (server side) 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...
-
CWE: 127 Buffer Underread BadSource: fscanf Read data from the console using fscanf() GoodSource: Non-negative but less than 10 Sinks: GoodSink: Ensure the array index is valid BadSink : Improperly check the array index by not checking to see if the value is negative Flow Variant: 66 Data f...
-
CWE: 121 Stack Based Buffer Overflow BadSource: Set data pointer to the bad buffer GoodSource: Set data pointer to the good buffer Sinks: loop BadSink : Copy int array to data using a loop Flow Variant: 45 Data flow: data passed as a static global variable from one function to another in th...
-
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...