idx int64 | target int64 | func string |
|---|---|---|
0 | 0 | static void test_function()
{
int data;
/* Initialize data */
data = 0;
CWE190_Integer_Overflow__int_fgets_multiply_83_test_function test_functionObject(data);
} |
1 | 1 | void test_function_124(char * data)
{
helper_function(
} |
2 | 0 | void test_function()
{
test_functionG2B();
} |
3 | 0 | void test_function_134()
{
helper_function(
helper_function(
} |
4 | 1 | void test_function_122()
{
if(GLOBAL_CONST_TRUE)
{
{
charVoid * structCharVoid = (charVoid *)malloc(sizeof(charVoid));
if (structCharVoid == NULL) {exit(-1);}
structCharVoid->voidSecond = (void *)SRC_STR;
/* Print the initial block pointed to by structCharVoid->voidSecond */
printWLine((wchar_t *)structChar... |
5 | 0 | void test_function_121()
{
helper_function(
} |
6 | 0 | static void test_function()
{
float data;
/* Initialize data */
data = 0.0F;
if(GLOBAL_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZ... |
7 | 0 | void test_function()
{
test_functionG2B();
test_functionB2G();
} |
8 | 0 | static void test_function(unsigned int data)
{
if(data > 0) /* ensure we won't have an underflow */
{
/* Alternative implementation */
if (data < (UINT_MAX/2))
{
unsigned int result = data * 2;
printUnsignedLine(result);
}
else
{
printLine("data value is too large to perform arithmetic safely.");
}
}
} |
9 | 1 | void test_function_194()
{
short data;
/* Initialize data */
data = 0;
/* Potential issue here */
data = (short)RAND32();
test_function_194Data = data;
helper_function(
} |
10 | 1 | void test_function_190()
{
short data;
data = 0;
/* Potential issue here */
data = SHRT_MAX;
helper_function(
} |
11 | 0 | void test_function_78()
{
helper_function(
helper_function(
} |
12 | 0 | helper_function(
{
{
wchar_t source[100];
wmemset(source, L'C', 100-1); /* fill with L'C's */
source[100-1] = L'\0'; /* null terminate */
/* Potential issue here */
memcpy(data, source, 100*sizeof(wchar_t));
data[100-1] = L'\0'; /* Ensure the destination buffer is null terminated */
printWLine(data);
delete [] data... |
13 | 0 | static void test_function()
{
char * data;
map<int, char *> dataMap;
char dataBuffer[FILENAME_MAX] = BASEPATH;
data = dataBuffer;
/* Alternative implementation */
strcat(data, "file.txt");
/* Put data in a map */
dataMap[0] = data;
dataMap[1] = data;
dataMap[2] = data;
test_functionSink(dataMap);
} |
14 | 0 | char * test_function_134(char * data)
{
/* Alternative implementation */
strcpy(data, "fixedstringtest");
return data;
} |
15 | 0 | static void test_function()
{
wchar_t * data;
wchar_t dataBuffer[100] = COMMAND_ARG2;
data = dataBuffer;
switch(6)
{
case 6:
/* Alternative implementation */
wcscat(data, L"*.*");
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
{... |
16 | 1 | void test_function_194()
{
short data;
/* Initialize data */
data = 0;
/* Potential issue here */
data = -1;
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* Potential issue here */
* the sign extension could result in a very large ... |
17 | 0 | void test_function()
{
test_functionG2B();
} |
18 | 0 | static void test_function()
{
int data;
/* Initialize data */
data = -1;
/* Alternative implementation */
data = 20;
{
size_t dataBytes,i;
int *intPointer;
/* Potential issue here */
dataBytes = data * sizeof(int); /* sizeof array in bytes */
intPointer = (int*)new char[dataBytes];
for (i = 0; i < (size_t)d... |
19 | 1 | void test_function_78()
{
char * data;
char dataBuffer[100] = COMMAND_ARG2;
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = strlen(data)... |
20 | 0 | static void test_function()
{
short data;
data = 0;
if(5!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* Alternative implementation */
data = -2;
}
if(5==5)
{
{
/* Potential issue here */
--data;
short result = data;
printIntLine(re... |
21 | 0 | void test_function_126()
{
helper_function(
helper_function(
} |
22 | 1 | void test_function()
{
char * data;
/* Initialize data */
data = NULL;
if(staticFive==5)
{
data = new char;
*data = 'A';
/* Potential issue here */
delete data;
}
if(staticFive==5)
{
/* Potential issue here */
printHexCharLine(*data);
/* POTENTIAL INCIDENTAL - Possible memory leak here if da... |
23 | 1 | void test_function()
{
wchar_t * data;
vector<wchar_t *> dataVector;
data = NULL;
/* Potential issue here */
data = new wchar_t[50];
data[0] = L'\0'; /* null terminate */
/* Put data in a vector */
dataVector.insert(dataVector.end(), 1, data);
dataVector.insert(dataVector.end(), 1, data);
dataVector.insert(data... |
24 | 0 | static void test_function()
{
char * data;
char * &dataRef = data;
data = NULL;
/* Alternative implementation */
data = (char *)malloc(100*sizeof(char));
if (data == NULL) {exit(-1);}
memset(data, 'A', 100-1); /* fill with 'A's */
data[100-1] = '\0'; /* null terminate */
{
char * data = dataRef;
{
char dest[100];
m... |
25 | 0 | void test_function()
{
test_functionG2B();
test_functionB2G();
} |
26 | 1 | void test_function_78()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
{
/* Read input from a file */
size_t dataLen = wcslen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFil... |
27 | 1 | void test_function()
{
int * data;
/* Initialize data*/
data = NULL;
if(staticFive==5)
{
/* Potential issue here */
data = (int *)calloc(100, sizeof(int));
if (data == NULL) {exit(-1);}
}
if(staticFive==5)
{
/* Potential issue here */
* require a call to free() to deallocate the memory */
delete []... |
28 | 0 | void test_function_190()
{
helper_function(
helper_function(
helper_function(
helper_function(
} |
29 | 1 | void test_function()
{
twoIntsStruct * data;
/* Initialize data*/
data = NULL;
if(globalReturnsTrue())
{
/* Potential issue here */
data = (twoIntsStruct *)malloc(100*sizeof(twoIntsStruct));
if (data == NULL) {exit(-1);}
}
if(globalReturnsTrue())
{
/* Potential issue here */
* require a call to fre... |
30 | 0 | void test_function(char * data)
{
{
HANDLE hFile;
/* Potential issue here */
hFile = CreateFileA(data,
(GENERIC_WRITE|GENERIC_READ),
0,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
CloseHandle(hFile);
}
}
} |
31 | 0 | static void test_function()
{
short data;
data = 0;
/* Potential issue here */
data = (short)RAND32();
CWE191_Integer_Underflow__short_rand_postdec_53b_test_functionSink(data);
} |
32 | 1 | void test_function_121()
{
char * data;
char * dataBadBuffer = (char *)ALLOCA((10)*sizeof(char));
char * dataGoodBuffer = (char *)ALLOCA((10+1)*sizeof(char));
if(globalTrue)
{
/* Potential issue here */
* string copies in the sinks */
data = dataBadBuffer;
data[0] = '\0'; /* null terminate */
}
{
char sou... |
33 | 0 | static void test_function()
{
char * data;
char dataBuffer[100] = "";
data = dataBuffer;
if(globalReturnsTrueOrFalse())
{
/* Alternative implementation */
strcpy(data, "C:\\Windows\\System32\\winsrv.dll");
}
else
{
/* Alternative implementation */
strcpy(data, "C:\\Windows\\System32\\winsrv.dll");
}
{
HMODULE h... |
34 | 0 | static void test_function(wchar_t * data, ...)
{
{
va_list args;
va_start(args, data);
/* Alternative implementation */
vwprintf(L"%s", args);
va_end(args);
}
} |
35 | 0 | void test_function_126()
{
helper_function(
} |
36 | 0 | void test_function()
{
test_functionG2B1();
test_functionG2B2();
} |
37 | 1 | void test_function_197(short data)
{
helper_function(
} |
38 | 0 | static void test_function()
{
int data;
/* Initialize data */
data = 0;
/* Potential issue here */
fscanf(stdin, "%d", &data);
{
int dataCopy = data;
int data = dataCopy;
/* Alternative implementation */
if (data > INT_MIN)
{
--data;
int result = data;
printIntLine(result);
}
else
{
printLine("data value is... |
39 | 1 | void test_function_127(int data) const
{
{
int buffer[10] = { 0 };
/* Potential issue here */
* This check does not check to see if the array index is negative */
if (data < 10)
{
printIntLine(buffer[data]);
}
else
{
printLine("ERROR: Array index is too big.");
}
}
} |
40 | 0 | void test_function_127()
{
helper_function(
helper_function(
} |
41 | 0 | static void test_function()
{
wchar_t * data;
list<wchar_t *> dataList;
data = NULL;
/* Alternative implementation */
data = new wchar_t[100];
wmemset(data, L'A', 100-1); /* fill with 'A's */
data[100-1] = L'\0'; /* null terminate */
/* Put data in a list */
dataList.push_back(data);
dataList.push_back(data);
d... |
42 | 1 | void test_function_369(int data)
{
helper_function(
} |
43 | 0 | static void test_function()
{
int64_t * data;
data = NULL; /* Initialize data */
/* Potential issue here */
data = (int64_t *)realloc(data, 1*sizeof(int64_t));
if(STATIC_CONST_FIVE!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* Alt... |
44 | 0 | void test_function()
{
test_functionG2B();
} |
45 | 0 | void test_function_197()
{
helper_function(
} |
46 | 0 | static void test_function()
{
struct _twoIntsStruct * data;
data = NULL;
if(staticTrue)
{
/* Potential issue here */
data = new struct _twoIntsStruct[100];
/* Initialize and make use of data */
data[0].intOne = 0;
data[0].intTwo = 0;
printStructLine((twoIntsStruct *)&data[0]);
}
if(staticTrue)
{
/* Alte... |
47 | 0 | void test_function_121()
{
helper_function(
helper_function(
} |
48 | 1 | void test_function_121()
{
char * data;
char * dataBadBuffer = (char *)ALLOCA(50*sizeof(char));
char * dataGoodBuffer = (char *)ALLOCA(100*sizeof(char));
if(globalReturnsTrue())
{
/* Potential issue here */
* buffer in various memory copying functions using a "large" source buffer. */
data = dataBadBuffer;... |
49 | 0 | void test_function_369(int data)
{
/* Alternative implementation */
if( data != 0 )
{
printIntLine(100 % data);
}
else
{
printLine("This would result in a divide by zero");
}
} |
50 | 0 | void test_function_134(wchar_t * data)
{
helper_function(
} |
51 | 1 | void test_function()
{
twoIntsStruct * data;
/* Initialize data */
data = NULL;
test_functionSource(data);
/* Potential issue here */
free(data);
} |
52 | 0 | static void test_function()
{
int64_t data;
data = 0LL;
/* Alternative implementation */
data = 2;
CWE190_Integer_Overflow__int64_t_fscanf_add_52b_test_functionSink(data);
} |
53 | 1 | void test_function()
{
char * data;
char * dataArray[5];
char dataBuffer[FILENAME_MAX] = "";
data = dataBuffer;
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (FILENAME_MAX-dataLen > 1)
{
pFile = fopen(... |
54 | 0 | void test_function_190(unsigned int dataArray[])
{
unsigned int data = dataArray[2];
{
/* Potential issue here */
data++;
unsigned int result = data;
printUnsignedLine(result);
}
} |
55 | 0 | void test_function()
{
test_functionG2B();
test_functionB2G();
} |
56 | 0 | static void test_function()
{
float data;
/* Initialize data */
data = 0.0F;
data = test_functionSource(data);
{
/* Potential issue here */
int result = (int)(100.0 / data);
printIntLine(result);
}
} |
57 | 0 | void test_function(int64_t * dataArray[])
{
int64_t * data = dataArray[2];
/* Potential issue here */
* require a call to free() to deallocate the memory */
delete data;
} |
58 | 1 | void test_function()
{
int64_t * data;
/* Initialize data*/
data = NULL;
/* Potential issue here */
data = new int64_t;
test_functionStatic = 1; /* true */
test_functionSink(data);
} |
59 | 1 | void test_function_190(short data)
{
if(data > 0) /* ensure we won't have an underflow */
{
/* Potential issue here */
short result = data * 2;
printIntLine(result);
}
} |
60 | 1 | void test_function_252()
{
/* Potential issue here */
putc((int)'A', stdout);
} |
61 | 0 | static void test_function()
{
char * data;
map<int, char *> dataMap;
char dataBuffer[FILENAME_MAX] = "";
data = dataBuffer;
#ifdef _WIN32
/* Alternative implementation */
strcat(data, "c:\\temp\\file.txt");
#else
/* Alternative implementation */
strcat(data, "/tmp/file.txt");
#endif
/* Put data in a map */
... |
62 | 0 | void test_function_195(CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memmove_67_structType myStruct)
{
int data = myStruct.structFirst;
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* Potential issue here */
* the sign convers... |
63 | 0 | static void test_function()
{
TwoIntsClass * data;
TwoIntsClass dataUninitArray[10];
data = dataUninitArray;
if(5==5)
{
/* Potential issue here */
; /* empty statement needed for some flow variants */
}
if(5!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed st... |
64 | 0 | static void test_function()
{
double * data;
test_functionSource(data);
/* Alternative implementation */
/* initialize both the pointer and the data pointed to */
data = (double *)malloc(sizeof(double));
if (data == NULL) {exit(-1);}
*data = 5.0;
printDoubleLine(*data);
} |
65 | 1 | void test_function_134()
{
wchar_t * data;
/* define a function pointer */
void (*funcPtr) (wchar_t *, ...) = CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_65b_badVaSink;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;... |
66 | 1 | helper_function(
{
{
/* Potential issue here */
int64_t result = data - 1;
printLongLongLine(result);
}
} |
67 | 0 | void test_function_369(float * dataPtr)
{
float data = *dataPtr;
/* Alternative implementation */
if(fabs(data) > 0.000001)
{
int result = (int)(100.0 / data);
printIntLine(result);
}
else
{
printLine("This would result in a divide by zero");
}
} |
68 | 0 | void test_function_400()
{
helper_function(
helper_function(
} |
69 | 0 | static void test_function()
{
char * data;
data = NULL;
/* Alternative implementation */
data = (char *)malloc(100*sizeof(char));
data[0] = '\0'; /* null terminate */
CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memmove_54b_test_functionSink(data);
} |
70 | 1 | void test_function_78(char * data)
{
helper_function(
} |
71 | 0 | static void test_function()
{
char * data;
void (*funcPtr) (char *) = test_functionSink;
char dataBuffer[100];
data = dataBuffer;
/* Alternative implementation */
memset(data, 'A', 50-1); /* fill with 'A's */
data[50-1] = '\0'; /* null terminate */
funcPtr(data);
} |
72 | 0 | static void test_function()
{
int data;
/* Initialize data */
data = -1;
if(1)
{
/* Alternative implementation */
data = 100-1;
}
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* Potential issue here */
* the sign conversion could r... |
73 | 0 | static void test_function()
{
char data;
data = ' ';
/* Potential issue here */
fscanf (stdin, "%c", &data);
CWE190_Integer_Overflow__char_fscanf_preinc_68_test_functionData = data;
CWE190_Integer_Overflow__char_fscanf_preinc_68b_test_functionSink();
} |
74 | 0 | static void test_function()
{
char * data;
char dataBuffer[100];
data = dataBuffer;
test_functionStatic = 0; /* false */
data = test_functionSource(data);
{
char dest[50] = "";
/* Potential issue here */
SNPRINTF(dest, strlen(data), "%s", data);
printLine(data);
}
} |
75 | 0 | void test_function()
{
test_functionG2B();
test_functionB2G();
} |
76 | 0 | void test_function_78(char * data)
{
/* execl - specify the path where the command is located */
/* Potential issue here */
EXECL(COMMAND_INT_PATH, COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG3, NULL);
} |
77 | 1 | void test_function_190()
{
short data;
data = 0;
if(globalFive==5)
{
/* Potential issue here */
data = (short)RAND32();
}
if(globalFive==5)
{
{
/* Potential issue here */
++data;
short result = data;
printIntLine(result);
}
}
} |
78 | 1 | void test_function_190()
{
int data;
/* Initialize data */
data = 0;
/* Potential issue here */
data = RAND32();
helper_function(
} |
79 | 0 | void test_function()
{
test_functionG2B();
} |
80 | 1 | void test_function_122()
{
int * data;
data = NULL;
if(staticFive==5)
{
/* Potential issue here */
data = (int *)malloc(10);
if (data == NULL) {exit(-1);}
}
{
int source[10] = {0};
/* Potential issue here */
memcpy(data, source, 10*sizeof(int));
printIntLine(data[0]);
free(data);
}
} |
81 | 0 | static void test_function(char * data, ...)
{
{
va_list args;
va_start(args, data);
/* Alternative implementation */
vfprintf(stdout, "%s", args);
va_end(args);
}
} |
82 | 1 | void test_function_121(wchar_t * data)
{
{
wchar_t source[10+1] = SRC_STRING;
/* Copy length + 1 to include NUL terminator from source */
/* Potential issue here */
wcsncpy(data, source, wcslen(source) + 1);
printWLine(data);
}
} |
83 | 0 | void test_function_78(wchar_t * data)
{
helper_function(
} |
84 | 0 | void test_function_190()
{
helper_function(
helper_function(
} |
85 | 1 | test_function_690(long * dataCopy)
{
data = dataCopy;
/* Potential issue here */
data = (long *)malloc(1*sizeof(long));
} |
86 | 1 | wchar_t * test_function_90(wchar_t * data)
{
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* Potential issue here */
wcsncat(data+da... |
87 | 1 | void test_function()
{
double * data;
data = new double[10];
test_functionSource(data);
/* Potential issue here */
{
int i;
for(i=0; i<10; i++)
{
printDoubleLine(data[i]);
}
}
/* deallocate the memory */
delete [] data;
} |
88 | 0 | void test_function_127()
{
helper_function(
helper_function(
} |
89 | 0 | void test_function()
{
test_functionG2B();
test_functionB2G();
} |
90 | 0 | static void test_function()
{
int data;
void (*funcPtr) (int) = test_functionSink;
/* Initialize data */
data = -1;
/* Potential issue here */
data = helper_function( O_RDWR|O_CREAT, S_IREAD|S_IWRITE);
funcPtr(data);
} |
91 | 1 | void test_function()
{
int data;
/* Initialize data */
data = -1;
data = test_functionSource(data);
{
int i;
int * buffer = new int[10];
/* initialize buffer */
for (i = 0; i < 10; i++)
{
buffer[i] = 0;
}
/* Potential issue here */
* This code does check to see if the array index is negative */
... |
92 | 0 | void test_function_665()
{
helper_function(
helper_function(
} |
93 | 1 | void test_function_190()
{
unsigned int data;
data = 0;
if(GLOBAL_CONST_TRUE)
{
/* Potential issue here */
fscanf (stdin, "%u", &data);
}
if(GLOBAL_CONST_TRUE)
{
{
/* Potential issue here */
unsigned int result = data * data;
printUnsignedLine(result);
}
}
} |
94 | 0 | void test_function_134(char * dataArray[])
{
char * data = dataArray[2];
{
char dest[100] = "";
/* Alternative implementation */
SNPRINTF(dest, 100-1, "%s", data);
printLine(dest);
}
} |
95 | 0 | static void test_function()
{
wchar_t * data;
/* Initialize data*/
data = NULL;
/* Alternative implementation */
data = new wchar_t;
const CWE762_Mismatched_Memory_Management_Routines__delete_wchar_t_malloc_81_base& baseObject = CWE762_Mismatched_Memory_Management_Routines__delete_wchar_t_malloc_81_test_functio... |
96 | 0 | void test_function_122()
{
helper_function(
} |
97 | 0 | static void test_function()
{
int data;
/* Initialize data */
data = -1;
if(GLOBAL_CONST_FALSE)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* Alternative implementation */
data = 20;
}
{
size_t dataBytes,i;
int *intPointer;
/* Pot... |
98 | 1 | void test_function_78()
{
wchar_t * data;
CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_execv_67_structType myStruct;
wchar_t dataBuffer[100] = COMMAND_ARG2;
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET liste... |
99 | 0 | void test_function()
{
test_functionG2B();
test_functionB2G();
} |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 5