Unnamed: 0
int64 0
56k
| source_code
stringlengths 55
5.98k
| comments
stringlengths 2
1.76k
| label
stringclasses 68
values | dataset_name
stringclasses 1
value | file_name
stringlengths 208
265
| function
stringlengths 27
87
| decompiled_code
stringlengths 68
3.97k
| compiler_options
stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|
52,600
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_67_bad()
{
short data;
CWE197_Numeric_Truncation_Error__short_listen_socket_67_structType myStruct;
/* Initialize data */
data = -1;
{
#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_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a number input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short */
data = (short)atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myStruct.structFirst = data;
CWE197_Numeric_Truncation_Error__short_listen_socket_67b_badSink(myStruct);
}
|
['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a number input from the network */', '/* NUL-terminate string */', '/* Convert to short */']
|
['CWE197']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/89415/CWE197_Numeric_Truncation_Error__short_listen_socket_67a.c
|
CWE197_Numeric_Truncation_Error__short_listen_socket_67_bad
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_67_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined2 uStack_1a;
int iStack_18;
int iStack_14;
int iStack_10;
undefined2 uStack_a;
uStack_a = 0xffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
uStack_a = func_0x00400d10(auStack_40);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_1a = uStack_a;
CWE197_Numeric_Truncation_Error__short_listen_socket_67b_badSink(uStack_a);
return;
}
|
['gcc']
|
52,601
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_67_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/89415/CWE197_Numeric_Truncation_Error__short_listen_socket_67a.c
|
CWE197_Numeric_Truncation_Error__short_listen_socket_67_good
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_67_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
52,602
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_67b_badSink(CWE197_Numeric_Truncation_Error__short_listen_socket_67_structType myStruct)
{
short data = myStruct.structFirst;
{
/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
char charData = (char)data;
printHexCharLine(charData);
}
}
|
['/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */']
|
['CWE197']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/89415/CWE197_Numeric_Truncation_Error__short_listen_socket_67b.c
|
CWE197_Numeric_Truncation_Error__short_listen_socket_67b_badSink
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_67b_badSink(char param_1)
{
printHexCharLine((int)param_1);
return;
}
|
['gcc']
|
52,603
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_67b_goodG2BSink(CWE197_Numeric_Truncation_Error__short_listen_socket_67_structType myStruct)
{
short data = myStruct.structFirst;
{
/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
char charData = (char)data;
printHexCharLine(charData);
}
}
|
['/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/89415/CWE197_Numeric_Truncation_Error__short_listen_socket_67b.c
|
CWE197_Numeric_Truncation_Error__short_listen_socket_67b_goodG2BSink
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_67b_goodG2BSink(char param_1)
{
printHexCharLine((int)param_1);
return;
}
|
['gcc']
|
52,604
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_68_bad()
{
short data;
/* Initialize data */
data = -1;
{
#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_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a number input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short */
data = (short)atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE197_Numeric_Truncation_Error__short_listen_socket_68_badData = data;
CWE197_Numeric_Truncation_Error__short_listen_socket_68b_badSink();
}
|
['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a number input from the network */', '/* NUL-terminate string */', '/* Convert to short */']
|
['CWE197']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/89416/CWE197_Numeric_Truncation_Error__short_listen_socket_68a.c
|
CWE197_Numeric_Truncation_Error__short_listen_socket_68_bad
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_68_bad(void)
{
int iVar1;
undefined auStack_30 [8];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined2 uStack_a;
uStack_a = 0xffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_30,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_30[iStack_18] = 0;
uStack_a = func_0x00400d10(auStack_30);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
CWE197_Numeric_Truncation_Error__short_listen_socket_68_badData = uStack_a;
CWE197_Numeric_Truncation_Error__short_listen_socket_68b_badSink();
return;
}
|
['gcc']
|
52,605
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_68_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/89416/CWE197_Numeric_Truncation_Error__short_listen_socket_68a.c
|
CWE197_Numeric_Truncation_Error__short_listen_socket_68_good
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_68_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
52,606
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_68b_badSink()
{
short data = CWE197_Numeric_Truncation_Error__short_listen_socket_68_badData;
{
/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
char charData = (char)data;
printHexCharLine(charData);
}
}
|
['/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */']
|
['CWE197']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/89416/CWE197_Numeric_Truncation_Error__short_listen_socket_68b.c
|
CWE197_Numeric_Truncation_Error__short_listen_socket_68b_badSink
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_68b_badSink(void)
{
printHexCharLine((int)(char)CWE197_Numeric_Truncation_Error__short_listen_socket_68_badData);
return;
}
|
['gcc']
|
52,607
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_68b_goodG2BSink()
{
short data = CWE197_Numeric_Truncation_Error__short_listen_socket_68_goodG2BData;
{
/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
char charData = (char)data;
printHexCharLine(charData);
}
}
|
['/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/89416/CWE197_Numeric_Truncation_Error__short_listen_socket_68b.c
|
CWE197_Numeric_Truncation_Error__short_listen_socket_68b_goodG2BSink
|
void CWE197_Numeric_Truncation_Error__short_listen_socket_68b_goodG2BSink(void)
{
printHexCharLine((int)(char)CWE197_Numeric_Truncation_Error__short_listen_socket_68_goodG2BData);
return;
}
|
['gcc']
|
52,608
|
void CWE252_Unchecked_Return_Value__char_fgets_08_bad()
{
if(staticReturnsTrue())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FLAW: Do not check the return value */
fgets(data, 100, stdin);
printLine(data);
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Do not check the return value */']
|
['CWE252']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92095/CWE252_Unchecked_Return_Value__char_fgets_08.c
|
CWE252_Unchecked_Return_Value__char_fgets_08_bad
|
void CWE252_Unchecked_Return_Value__char_fgets_08_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
undefined8 *puStack_10;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
puStack_10 = &uStack_78;
printLine(&UNK_00401214);
func_0x00400a70(puStack_10,100,stdin);
printLine(puStack_10);
}
return;
}
|
['gcc']
|
52,609
|
void CWE252_Unchecked_Return_Value__char_fgets_08_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92095/CWE252_Unchecked_Return_Value__char_fgets_08.c
|
CWE252_Unchecked_Return_Value__char_fgets_08_good
|
void CWE252_Unchecked_Return_Value__char_fgets_08_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,610
|
void CWE252_Unchecked_Return_Value__char_fgets_11_bad()
{
if(globalReturnsTrue())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FLAW: Do not check the return value */
fgets(data, 100, stdin);
printLine(data);
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Do not check the return value */']
|
['CWE252']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92098/CWE252_Unchecked_Return_Value__char_fgets_11.c
|
CWE252_Unchecked_Return_Value__char_fgets_11_bad
|
void CWE252_Unchecked_Return_Value__char_fgets_11_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
puStack_10 = &uStack_78;
printLine(&UNK_004011f4);
func_0x00400a70(puStack_10,100,stdin);
printLine(puStack_10);
}
return;
}
|
['gcc']
|
52,611
|
void CWE252_Unchecked_Return_Value__char_fgets_11_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92098/CWE252_Unchecked_Return_Value__char_fgets_11.c
|
CWE252_Unchecked_Return_Value__char_fgets_11_good
|
void CWE252_Unchecked_Return_Value__char_fgets_11_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,612
|
void CWE252_Unchecked_Return_Value__char_fgets_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FLAW: Do not check the return value */
fgets(data, 100, stdin);
printLine(data);
}
}
else
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FIX: check the return value */
if (fgets(data, 100, stdin) == NULL)
{
printLine("fgets failed!");
exit(1);
}
printLine(data);
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Do not check the return value */', '/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FIX: check the return value */']
|
['CWE252']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92099/CWE252_Unchecked_Return_Value__char_fgets_12.c
|
CWE252_Unchecked_Return_Value__char_fgets_12_bad
|
void CWE252_Unchecked_Return_Value__char_fgets_12_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_10 = &uStack_88;
printLine(&UNK_00401304);
lVar2 = func_0x00400ab0(puStack_10,100,stdin);
if (lVar2 == 0) {
printLine(&UNK_0040131c);
func_0x00400b10(1);
}
printLine(puStack_10);
}
else {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
printLine(&UNK_00401304);
func_0x00400ab0(puStack_18,100,stdin);
printLine(puStack_18);
}
return;
}
|
['gcc']
|
52,613
|
void CWE252_Unchecked_Return_Value__char_fgets_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92099/CWE252_Unchecked_Return_Value__char_fgets_12.c
|
CWE252_Unchecked_Return_Value__char_fgets_12_good
|
void CWE252_Unchecked_Return_Value__char_fgets_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,614
|
void CWE252_Unchecked_Return_Value__char_fgets_17_bad()
{
int j;
for(j = 0; j < 1; j++)
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FLAW: Do not check the return value */
fgets(data, 100, stdin);
printLine(data);
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Do not check the return value */']
|
['CWE252']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92104/CWE252_Unchecked_Return_Value__char_fgets_17.c
|
CWE252_Unchecked_Return_Value__char_fgets_17_bad
|
void CWE252_Unchecked_Return_Value__char_fgets_17_bad(void)
{
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
int iStack_c;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
printLine(&UNK_00401204);
func_0x00400a70(puStack_18,100,stdin);
printLine(puStack_18);
}
return;
}
|
['gcc']
|
52,615
|
void CWE252_Unchecked_Return_Value__char_fgets_17_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92104/CWE252_Unchecked_Return_Value__char_fgets_17.c
|
CWE252_Unchecked_Return_Value__char_fgets_17_good
|
void CWE252_Unchecked_Return_Value__char_fgets_17_good(void)
{
good1();
return;
}
|
['gcc']
|
52,616
|
void CWE252_Unchecked_Return_Value__char_fscanf_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FLAW: Do not check the return value */
fscanf(stdin, "%99s\0", data);
}
}
else
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FIX: check the return value */
if (fscanf(stdin, "%99s\0", data) == EOF)
{
printLine("fscanf failed!");
}
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Do not check the return value */', '/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FIX: check the return value */']
|
['CWE252']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92189/CWE252_Unchecked_Return_Value__char_fscanf_12.c
|
CWE252_Unchecked_Return_Value__char_fscanf_12_bad
|
void CWE252_Unchecked_Return_Value__char_fscanf_12_bad(void)
{
int iVar1;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_10 = &uStack_88;
iVar1 = func_0x00400a20(stdin,&UNK_00401284,puStack_10);
if (iVar1 == -1) {
printLine(&UNK_0040128a);
}
}
else {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
func_0x00400a20(stdin,&UNK_00401284,puStack_18);
}
return;
}
|
['gcc']
|
52,617
|
void CWE252_Unchecked_Return_Value__char_fscanf_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92189/CWE252_Unchecked_Return_Value__char_fscanf_12.c
|
CWE252_Unchecked_Return_Value__char_fscanf_12_good
|
void CWE252_Unchecked_Return_Value__char_fscanf_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,618
|
void CWE252_Unchecked_Return_Value__char_scanf_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FLAW: Do not check the return value */
scanf("%99s\0", data);
}
}
else
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FIX: check the return value */
if (scanf("%99s\0", data) == EOF)
{
printLine("scanf failed!");
}
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Do not check the return value */', '/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FIX: check the return value */']
|
['CWE252']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92315/CWE252_Unchecked_Return_Value__char_scanf_12.c
|
CWE252_Unchecked_Return_Value__char_scanf_12_bad
|
void CWE252_Unchecked_Return_Value__char_scanf_12_bad(void)
{
int iVar1;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_10 = &uStack_88;
iVar1 = func_0x00400a90(&UNK_00401244,puStack_10);
if (iVar1 == -1) {
printLine(&UNK_0040124a);
}
}
else {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
func_0x00400a90(&UNK_00401244,puStack_18);
}
return;
}
|
['gcc']
|
52,619
|
void CWE252_Unchecked_Return_Value__char_scanf_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92315/CWE252_Unchecked_Return_Value__char_scanf_12.c
|
CWE252_Unchecked_Return_Value__char_scanf_12_good
|
void CWE252_Unchecked_Return_Value__char_scanf_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,620
|
void CWE252_Unchecked_Return_Value__char_sscanf_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FLAW: Do not check the return value */
sscanf(SRC, "%99s\0", data);
}
}
else
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FIX: check the return value */
if (sscanf(SRC, "%99s\0", data) == EOF)
{
printLine("sscanf failed!");
}
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Do not check the return value */', '/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FIX: check the return value */']
|
['CWE252']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92351/CWE252_Unchecked_Return_Value__char_sscanf_12.c
|
CWE252_Unchecked_Return_Value__char_sscanf_12_bad
|
void CWE252_Unchecked_Return_Value__char_sscanf_12_bad(void)
{
int iVar1;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_10 = &uStack_88;
iVar1 = func_0x00400a30(&UNK_004011fa,&UNK_004011f4,puStack_10);
if (iVar1 == -1) {
printLine(&UNK_00401201);
}
}
else {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
func_0x00400a30(&UNK_004011fa,&UNK_004011f4,puStack_18);
}
return;
}
|
['gcc']
|
52,621
|
void CWE252_Unchecked_Return_Value__char_sscanf_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92351/CWE252_Unchecked_Return_Value__char_sscanf_12.c
|
CWE252_Unchecked_Return_Value__char_sscanf_12_good
|
void CWE252_Unchecked_Return_Value__char_sscanf_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,622
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_08_bad()
{
if(staticReturnsTrue())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FLAW: Incorrectly check the return value: if this function failed it will return NULL,
* but we are checking to see if the return value is less than 0. */
if (fgets(data, 100, stdin) < 0)
{
printLine("fgets failed!");
exit(1);
}
printLine(data);
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Incorrectly check the return value: if this function failed it will return NULL,\r\n * but we are checking to see if the return value is less than 0. */']
|
['CWE253']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92725/CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_08.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_08_bad
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_08_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
undefined8 *puStack_10;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
puStack_10 = &uStack_78;
printLine(&UNK_00401214);
func_0x00400a70(puStack_10,100,stdin);
printLine(puStack_10);
}
return;
}
|
['gcc']
|
52,623
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_08_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92725/CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_08.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_08_good
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_08_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,624
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_11_bad()
{
if(globalReturnsTrue())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FLAW: Incorrectly check the return value: if this function failed it will return NULL,
* but we are checking to see if the return value is less than 0. */
if (fgets(data, 100, stdin) < 0)
{
printLine("fgets failed!");
exit(1);
}
printLine(data);
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Incorrectly check the return value: if this function failed it will return NULL,\r\n * but we are checking to see if the return value is less than 0. */']
|
['CWE253']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92728/CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_11.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_11_bad
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_11_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
puStack_10 = &uStack_78;
printLine(&UNK_004011f4);
func_0x00400a70(puStack_10,100,stdin);
printLine(puStack_10);
}
return;
}
|
['gcc']
|
52,625
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_11_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92728/CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_11.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_11_good
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_11_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,626
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FLAW: Incorrectly check the return value: if this function failed it will return NULL,
* but we are checking to see if the return value is less than 0. */
if (fgets(data, 100, stdin) < 0)
{
printLine("fgets failed!");
exit(1);
}
printLine(data);
}
}
else
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FIX: check for the correct return value */
if (fgets(data, 100, stdin) == NULL)
{
printLine("fgets failed!");
exit(1);
}
printLine(data);
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Incorrectly check the return value: if this function failed it will return NULL,\r\n * but we are checking to see if the return value is less than 0. */', '/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FIX: check for the correct return value */']
|
['CWE253']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92729/CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_12.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_12_bad
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_12_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_10 = &uStack_88;
printLine(&UNK_00401304);
lVar2 = func_0x00400ab0(puStack_10,100,stdin);
if (lVar2 == 0) {
printLine(&UNK_0040131c);
func_0x00400b10(1);
}
printLine(puStack_10);
}
else {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
printLine(&UNK_00401304);
func_0x00400ab0(puStack_18,100,stdin);
printLine(puStack_18);
}
return;
}
|
['gcc']
|
52,627
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92729/CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_12.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_12_good
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,628
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_17_bad()
{
int j;
for(j = 0; j < 1; j++)
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
printLine("Please enter a string: ");
/* FLAW: Incorrectly check the return value: if this function failed it will return NULL,
* but we are checking to see if the return value is less than 0. */
if (fgets(data, 100, stdin) < 0)
{
printLine("fgets failed!");
exit(1);
}
printLine(data);
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: Incorrectly check the return value: if this function failed it will return NULL,\r\n * but we are checking to see if the return value is less than 0. */']
|
['CWE253']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92734/CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_17.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_17_bad
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_17_bad(void)
{
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
int iStack_c;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
printLine(&UNK_00401204);
func_0x00400a70(puStack_18,100,stdin);
printLine(puStack_18);
}
return;
}
|
['gcc']
|
52,629
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_17_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92734/CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_17.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_17_good
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_17_good(void)
{
good1();
return;
}
|
['gcc']
|
52,630
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FLAW: fscanf() might fail, in which case the return value will be EOF (-1), but
* we are checking to see if the return value is 0 */
if (fscanf(stdin, "%99s\0", data) == 0)
{
printLine("fscanf failed!");
}
}
}
else
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FIX: check for the correct return value */
if (fscanf(stdin, "%99s\0", data) == EOF)
{
printLine("fscanf failed!");
}
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: fscanf() might fail, in which case the return value will be EOF (-1), but\r\n * we are checking to see if the return value is 0 */', '/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FIX: check for the correct return value */']
|
['CWE253']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92819/CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_12.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_12_bad
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_12_bad(void)
{
int iVar1;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_10 = &uStack_88;
iVar1 = func_0x00400a20(stdin,&UNK_00401294,puStack_10);
if (iVar1 == -1) {
printLine(&UNK_0040129a);
}
}
else {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
iVar1 = func_0x00400a20(stdin,&UNK_00401294,puStack_18);
if (iVar1 == 0) {
printLine(&UNK_0040129a);
}
}
return;
}
|
['gcc']
|
52,631
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92819/CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_12.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_12_good
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,632
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FLAW: scanf() might fail, in which case the return value will be EOF (-1),
* but we are checking to see if the return value is 0 */
if (scanf("%99s\0", data) == 0)
{
printLine("scanf failed!");
}
}
}
else
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FIX: check for the correct return value */
if (scanf("%99s\0", data) == EOF)
{
printLine("scanf failed!");
}
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: scanf() might fail, in which case the return value will be EOF (-1),\r\n * but we are checking to see if the return value is 0 */', '/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FIX: check for the correct return value */']
|
['CWE253']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92945/CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_12.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_12_bad
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_12_bad(void)
{
int iVar1;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_10 = &uStack_88;
iVar1 = func_0x00400a90(&UNK_00401264,puStack_10);
if (iVar1 == -1) {
printLine(&UNK_0040126a);
}
}
else {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
iVar1 = func_0x00400a90(&UNK_00401264,puStack_18);
if (iVar1 == 0) {
printLine(&UNK_0040126a);
}
}
return;
}
|
['gcc']
|
52,633
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92945/CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_12.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_12_good
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,634
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FLAW: sscanf() might fail, in which case the return value will be EOF (-1), but
* we are checking to see if the return value is 0 */
if (sscanf(SRC_STRING, "%99s\0", data) == 0)
{
printLine("sscanf failed!");
}
}
}
else
{
{
/* By initializing dataBuffer, we ensure this will not be the
* CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */
char dataBuffer[100] = "";
char * data = dataBuffer;
/* FIX: check for the correct return value */
if (sscanf(SRC_STRING, "%99s\0", data) == EOF)
{
printLine("sscanf failed!");
}
}
}
}
|
['/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FLAW: sscanf() might fail, in which case the return value will be EOF (-1), but\r\n * we are checking to see if the return value is 0 */', '/* By initializing dataBuffer, we ensure this will not be the\r\n * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgets() and other variants */', '/* FIX: check for the correct return value */']
|
['CWE253']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92981/CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_12.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_12_bad
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_12_bad(void)
{
int iVar1;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined4 uStack_28;
undefined8 *puStack_18;
undefined8 *puStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_10 = &uStack_88;
iVar1 = func_0x00400a30(&UNK_0040120a,&UNK_00401204,puStack_10);
if (iVar1 == -1) {
printLine(&UNK_00401211);
}
}
else {
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
puStack_18 = &uStack_88;
iVar1 = func_0x00400a30(&UNK_0040120a,&UNK_00401204,puStack_18);
if (iVar1 == 0) {
printLine(&UNK_00401211);
}
}
return;
}
|
['gcc']
|
52,635
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/92981/CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_12.c
|
CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_12_good
|
void CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,636
|
void CWE364_Signal_Handler_Race_Condition__basic_08_bad()
{
if(staticReturnsTrue())
{
{
structSigAtomic *gStructSigAtomic = NULL;
signal(SIGINT, SIG_DFL);
if (CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad = NULL;
}
gStructSigAtomic = (structSigAtomic*)malloc(sizeof(structSigAtomic));
/* INCIDENTAL - No check for NULL on malloc() */
CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad = gStructSigAtomic;
CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad->val = 1;
/* Assign CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad BEFORE
* calling 'signal', because pointer types are not (according to spec), atomic
* with respect to signals.
*
* In practice they are on most (all?) POSIX-y computers, but thems the
* rules
*/
signal(SIGINT, helperBad);
/* FLAW: This test, free, and set operation is not atomic, so if signal
* delivery occurs (for example) between the free and setting to NULL,
* the signal handler could corrupt the heap, cause an access violation,
* etc
*
* Technically, "CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad = 0" is not atomic on certain theoretical computer
* systems that don't actually exist, but this should trigger on
* theoretical as well as actual computer systems.
*/
if (CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad = NULL;
}
}
}
}
|
['/* INCIDENTAL - No check for NULL on malloc() */', "/* Assign CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad BEFORE\r\n * calling 'signal', because pointer types are not (according to spec), atomic\r\n * with respect to signals.\r\n *\r\n * In practice they are on most (all?) POSIX-y computers, but thems the\r\n * rules\r\n */", '/* FLAW: This test, free, and set operation is not atomic, so if signal\r\n * delivery occurs (for example) between the free and setting to NULL,\r\n * the signal handler could corrupt the heap, cause an access violation,\r\n * etc\r\n *\r\n * Technically, "CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad = 0" is not atomic on certain theoretical computer\r\n * systems that don\'t actually exist, but this should trigger on\r\n * theoretical as well as actual computer systems.\r\n */']
|
['CWE364']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94591/CWE364_Signal_Handler_Race_Condition__basic_08.c
|
CWE364_Signal_Handler_Race_Condition__basic_08_bad
|
void CWE364_Signal_Handler_Race_Condition__basic_08_bad(void)
{
int iVar1;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
func_0x00400ad0(2,0);
if (CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad = (undefined4 *)0x0;
}
CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad =
(undefined4 *)func_0x00400b00(4);
*CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad = 1;
func_0x00400ad0(2,helperBad);
if (CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_08StructSigAtomicBad = (undefined4 *)0x0;
}
}
return;
}
|
['gcc']
|
52,637
|
void CWE364_Signal_Handler_Race_Condition__basic_08_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94591/CWE364_Signal_Handler_Race_Condition__basic_08.c
|
CWE364_Signal_Handler_Race_Condition__basic_08_good
|
void CWE364_Signal_Handler_Race_Condition__basic_08_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,638
|
void CWE364_Signal_Handler_Race_Condition__basic_11_bad()
{
if(globalReturnsTrue())
{
{
structSigAtomic *gStructSigAtomic = NULL;
signal(SIGINT, SIG_DFL);
if (CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad = NULL;
}
gStructSigAtomic = (structSigAtomic*)malloc(sizeof(structSigAtomic));
/* INCIDENTAL - No check for NULL on malloc() */
CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad = gStructSigAtomic;
CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad->val = 1;
/* Assign CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad BEFORE
* calling 'signal', because pointer types are not (according to spec), atomic
* with respect to signals.
*
* In practice they are on most (all?) POSIX-y computers, but thems the
* rules
*/
signal(SIGINT, helperBad);
/* FLAW: This test, free, and set operation is not atomic, so if signal
* delivery occurs (for example) between the free and setting to NULL,
* the signal handler could corrupt the heap, cause an access violation,
* etc
*
* Technically, "CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad = 0" is not atomic on certain theoretical computer
* systems that don't actually exist, but this should trigger on
* theoretical as well as actual computer systems.
*/
if (CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad = NULL;
}
}
}
}
|
['/* INCIDENTAL - No check for NULL on malloc() */', "/* Assign CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad BEFORE\r\n * calling 'signal', because pointer types are not (according to spec), atomic\r\n * with respect to signals.\r\n *\r\n * In practice they are on most (all?) POSIX-y computers, but thems the\r\n * rules\r\n */", '/* FLAW: This test, free, and set operation is not atomic, so if signal\r\n * delivery occurs (for example) between the free and setting to NULL,\r\n * the signal handler could corrupt the heap, cause an access violation,\r\n * etc\r\n *\r\n * Technically, "CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad = 0" is not atomic on certain theoretical computer\r\n * systems that don\'t actually exist, but this should trigger on\r\n * theoretical as well as actual computer systems.\r\n */']
|
['CWE364']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94594/CWE364_Signal_Handler_Race_Condition__basic_11.c
|
CWE364_Signal_Handler_Race_Condition__basic_11_bad
|
void CWE364_Signal_Handler_Race_Condition__basic_11_bad(void)
{
int iVar1;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
func_0x00400ad0(2,0);
if (CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad = (undefined4 *)0x0;
}
CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad =
(undefined4 *)func_0x00400b00(4);
*CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad = 1;
func_0x00400ad0(2,helperBad);
if (CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_11StructSigAtomicBad = (undefined4 *)0x0;
}
}
return;
}
|
['gcc']
|
52,639
|
void CWE364_Signal_Handler_Race_Condition__basic_11_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94594/CWE364_Signal_Handler_Race_Condition__basic_11.c
|
CWE364_Signal_Handler_Race_Condition__basic_11_good
|
void CWE364_Signal_Handler_Race_Condition__basic_11_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,640
|
void CWE364_Signal_Handler_Race_Condition__basic_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
structSigAtomic *gStructSigAtomic = NULL;
signal(SIGINT, SIG_DFL);
if (CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad = NULL;
}
gStructSigAtomic = (structSigAtomic*)malloc(sizeof(structSigAtomic));
/* INCIDENTAL - No check for NULL on malloc() */
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad = gStructSigAtomic;
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad->val = 1;
/* Assign CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad BEFORE
* calling 'signal', because pointer types are not (according to spec), atomic
* with respect to signals.
*
* In practice they are on most (all?) POSIX-y computers, but thems the
* rules
*/
signal(SIGINT, helperBad);
/* FLAW: This test, free, and set operation is not atomic, so if signal
* delivery occurs (for example) between the free and setting to NULL,
* the signal handler could corrupt the heap, cause an access violation,
* etc
*
* Technically, "CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad = 0" is not atomic on certain theoretical computer
* systems that don't actually exist, but this should trigger on
* theoretical as well as actual computer systems.
*/
if (CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad = NULL;
}
}
}
else
{
{
structSigAtomic *gStructSigAtomic = NULL;
signal(SIGINT, SIG_DFL);
if (CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood);
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood = 0;
}
gStructSigAtomic = (structSigAtomic*)malloc(sizeof(structSigAtomic));
/* INCIDENTAL - No check for NULL on malloc() */
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood = gStructSigAtomic;
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood->val = 1;
/* Assign CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood BEFORE
* calling 'signal', because pointer types are not (according to spec), atomic
* with respect to signals.
*
* In practice they are on most (all?) POSIX-y computers, but thems the
* rules
*/
signal(SIGINT, helperGood);
/* FIX: In this instance, the fix is to temporarily disable the signal
* handler while performing non-atomic operations. Another way would
* be to use sigprocmask or sigvec, or to restructure the signal handler
* to operate in a safe manner.
*/
signal(SIGINT, SIG_DFL);
if (CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood);
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood = NULL;
}
signal(SIGINT, helperGood);
}
}
}
|
['/* INCIDENTAL - No check for NULL on malloc() */', "/* Assign CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad BEFORE\r\n * calling 'signal', because pointer types are not (according to spec), atomic\r\n * with respect to signals.\r\n *\r\n * In practice they are on most (all?) POSIX-y computers, but thems the\r\n * rules\r\n */", '/* FLAW: This test, free, and set operation is not atomic, so if signal\r\n * delivery occurs (for example) between the free and setting to NULL,\r\n * the signal handler could corrupt the heap, cause an access violation,\r\n * etc\r\n *\r\n * Technically, "CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad = 0" is not atomic on certain theoretical computer\r\n * systems that don\'t actually exist, but this should trigger on\r\n * theoretical as well as actual computer systems.\r\n */', '/* INCIDENTAL - No check for NULL on malloc() */', "/* Assign CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood BEFORE\r\n * calling 'signal', because pointer types are not (according to spec), atomic\r\n * with respect to signals.\r\n *\r\n * In practice they are on most (all?) POSIX-y computers, but thems the\r\n * rules\r\n */", '/* FIX: In this instance, the fix is to temporarily disable the signal\r\n * handler while performing non-atomic operations. Another way would\r\n * be to use sigprocmask or sigvec, or to restructure the signal handler\r\n * to operate in a safe manner.\r\n */']
|
['CWE364']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94595/CWE364_Signal_Handler_Race_Condition__basic_12.c
|
CWE364_Signal_Handler_Race_Condition__basic_12_bad
|
void CWE364_Signal_Handler_Race_Condition__basic_12_bad(void)
{
int iVar1;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
func_0x00400ad0(2,0);
if (CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood);
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood = (undefined4 *)0x0;
}
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood =
(undefined4 *)func_0x00400b00(4);
*CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood = 1;
func_0x00400ad0(2,helperGood);
func_0x00400ad0(2,0);
if (CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood);
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicGood = (undefined4 *)0x0;
}
func_0x00400ad0(2,helperGood);
}
else {
func_0x00400ad0(2,0);
if (CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad = (undefined4 *)0x0;
}
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad =
(undefined4 *)func_0x00400b00(4);
*CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad = 1;
func_0x00400ad0(2,helperBad);
if (CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_12StructSigAtomicBad = (undefined4 *)0x0;
}
}
return;
}
|
['gcc']
|
52,641
|
void CWE364_Signal_Handler_Race_Condition__basic_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94595/CWE364_Signal_Handler_Race_Condition__basic_12.c
|
CWE364_Signal_Handler_Race_Condition__basic_12_good
|
void CWE364_Signal_Handler_Race_Condition__basic_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,642
|
void CWE364_Signal_Handler_Race_Condition__basic_17_bad()
{
int j;
for(j = 0; j < 1; j++)
{
{
structSigAtomic *gStructSigAtomic = NULL;
signal(SIGINT, SIG_DFL);
if (CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad = NULL;
}
gStructSigAtomic = (structSigAtomic*)malloc(sizeof(structSigAtomic));
/* INCIDENTAL - No check for NULL on malloc() */
CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad = gStructSigAtomic;
CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad->val = 1;
/* Assign CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad BEFORE
* calling 'signal', because pointer types are not (according to spec), atomic
* with respect to signals.
*
* In practice they are on most (all?) POSIX-y computers, but thems the
* rules
*/
signal(SIGINT, helperBad);
/* FLAW: This test, free, and set operation is not atomic, so if signal
* delivery occurs (for example) between the free and setting to NULL,
* the signal handler could corrupt the heap, cause an access violation,
* etc
*
* Technically, "CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad = 0" is not atomic on certain theoretical computer
* systems that don't actually exist, but this should trigger on
* theoretical as well as actual computer systems.
*/
if (CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad != NULL)
{
free(CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad = NULL;
}
}
}
}
|
['/* INCIDENTAL - No check for NULL on malloc() */', "/* Assign CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad BEFORE\r\n * calling 'signal', because pointer types are not (according to spec), atomic\r\n * with respect to signals.\r\n *\r\n * In practice they are on most (all?) POSIX-y computers, but thems the\r\n * rules\r\n */", '/* FLAW: This test, free, and set operation is not atomic, so if signal\r\n * delivery occurs (for example) between the free and setting to NULL,\r\n * the signal handler could corrupt the heap, cause an access violation,\r\n * etc\r\n *\r\n * Technically, "CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad = 0" is not atomic on certain theoretical computer\r\n * systems that don\'t actually exist, but this should trigger on\r\n * theoretical as well as actual computer systems.\r\n */']
|
['CWE364']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94600/CWE364_Signal_Handler_Race_Condition__basic_17.c
|
CWE364_Signal_Handler_Race_Condition__basic_17_bad
|
void CWE364_Signal_Handler_Race_Condition__basic_17_bad(void)
{
int iStack_c;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
func_0x00400ad0(2,0);
if (CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad = (undefined4 *)0x0;
}
CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad =
(undefined4 *)func_0x00400b00(4);
*CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad = 1;
func_0x00400ad0(2,helperBad);
if (CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad != (undefined4 *)0x0) {
func_0x00400a60(CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad);
CWE364_Signal_Handler_Race_Condition__basic_17StructSigAtomicBad = (undefined4 *)0x0;
}
}
return;
}
|
['gcc']
|
52,643
|
void CWE364_Signal_Handler_Race_Condition__basic_17_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94600/CWE364_Signal_Handler_Race_Condition__basic_17.c
|
CWE364_Signal_Handler_Race_Condition__basic_17_good
|
void CWE364_Signal_Handler_Race_Condition__basic_17_good(void)
{
good1();
return;
}
|
['gcc']
|
52,644
|
void CWE367_TOC_TOU__access_01_bad()
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94638/CWE367_TOC_TOU__access_01.c
|
CWE367_TOC_TOU__access_01_bad
|
void CWE367_TOC_TOU__access_01_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e50;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e5f;
printLine(&UNK_00401484);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e7a;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400e94;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400ea3;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eb9;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ecc;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ee0;
lVar2 = func_0x00400bd0(iStack_c,&UNK_00401493,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400ef0;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f00;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,645
|
void CWE367_TOC_TOU__access_01_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94638/CWE367_TOC_TOU__access_01.c
|
CWE367_TOC_TOU__access_01_good
|
void CWE367_TOC_TOU__access_01_good(void)
{
good1();
return;
}
|
['gcc']
|
52,646
|
void CWE367_TOC_TOU__access_02_bad()
{
if(1)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94639/CWE367_TOC_TOU__access_02.c
|
CWE367_TOC_TOU__access_02_bad
|
void CWE367_TOC_TOU__access_02_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e50;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e5f;
printLine(&UNK_00401484);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e7a;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400e94;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400ea3;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eb9;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ecc;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ee0;
lVar2 = func_0x00400bd0(iStack_c,&UNK_00401493,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400ef0;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f00;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,647
|
void CWE367_TOC_TOU__access_02_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94639/CWE367_TOC_TOU__access_02.c
|
CWE367_TOC_TOU__access_02_good
|
void CWE367_TOC_TOU__access_02_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,648
|
void CWE367_TOC_TOU__access_03_bad()
{
if(5==5)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94640/CWE367_TOC_TOU__access_03.c
|
CWE367_TOC_TOU__access_03_bad
|
void CWE367_TOC_TOU__access_03_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e50;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e5f;
printLine(&UNK_00401484);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e7a;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400e94;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400ea3;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eb9;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ecc;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ee0;
lVar2 = func_0x00400bd0(iStack_c,&UNK_00401493,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400ef0;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f00;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,649
|
void CWE367_TOC_TOU__access_03_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94640/CWE367_TOC_TOU__access_03.c
|
CWE367_TOC_TOU__access_03_good
|
void CWE367_TOC_TOU__access_03_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,650
|
void CWE367_TOC_TOU__access_04_bad()
{
if(STATIC_CONST_TRUE)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94641/CWE367_TOC_TOU__access_04.c
|
CWE367_TOC_TOU__access_04_bad
|
void CWE367_TOC_TOU__access_04_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e5d;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6c;
printLine(&UNK_0040149c);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e87;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea1;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb0;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec6;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ed9;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eed;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ab,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400efd;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f0d;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,651
|
void CWE367_TOC_TOU__access_04_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94641/CWE367_TOC_TOU__access_04.c
|
CWE367_TOC_TOU__access_04_good
|
void CWE367_TOC_TOU__access_04_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,652
|
void CWE367_TOC_TOU__access_05_bad()
{
if(staticTrue)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94642/CWE367_TOC_TOU__access_05.c
|
CWE367_TOC_TOU__access_05_bad
|
void CWE367_TOC_TOU__access_05_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
if (staticTrue != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e5e;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6d;
printLine(&UNK_00401494);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e88;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea2;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb1;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec7;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400eda;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eee;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014a3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400efe;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f0e;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,653
|
void CWE367_TOC_TOU__access_05_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94642/CWE367_TOC_TOU__access_05.c
|
CWE367_TOC_TOU__access_05_good
|
void CWE367_TOC_TOU__access_05_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,654
|
void CWE367_TOC_TOU__access_06_bad()
{
if(STATIC_CONST_FIVE==5)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94643/CWE367_TOC_TOU__access_06.c
|
CWE367_TOC_TOU__access_06_bad
|
void CWE367_TOC_TOU__access_06_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e5e;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6d;
printLine(&UNK_00401498);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e88;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea2;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb1;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec7;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400eda;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eee;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014a7,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400efe;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f0e;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,655
|
void CWE367_TOC_TOU__access_06_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94643/CWE367_TOC_TOU__access_06.c
|
CWE367_TOC_TOU__access_06_good
|
void CWE367_TOC_TOU__access_06_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,656
|
void CWE367_TOC_TOU__access_07_bad()
{
if(staticFive==5)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94644/CWE367_TOC_TOU__access_07.c
|
CWE367_TOC_TOU__access_07_bad
|
void CWE367_TOC_TOU__access_07_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
if (staticFive == 5) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e5f;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6e;
printLine(&UNK_00401494);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e89;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea3;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb2;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec8;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400edb;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eef;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014a3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400eff;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f0f;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,657
|
void CWE367_TOC_TOU__access_07_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94644/CWE367_TOC_TOU__access_07.c
|
CWE367_TOC_TOU__access_07_good
|
void CWE367_TOC_TOU__access_07_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,658
|
void CWE367_TOC_TOU__access_08_bad()
{
if(staticReturnsTrue())
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94645/CWE367_TOC_TOU__access_08.c
|
CWE367_TOC_TOU__access_08_bad
|
void CWE367_TOC_TOU__access_08_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_80 = &UNK_00400dea;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e78;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e87;
printLine(&UNK_004014a4);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400ea2;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ebc;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400ecb;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ee1;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ef4;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400f08;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014b3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400f18;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f28;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,659
|
void CWE367_TOC_TOU__access_08_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94645/CWE367_TOC_TOU__access_08.c
|
CWE367_TOC_TOU__access_08_good
|
void CWE367_TOC_TOU__access_08_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,660
|
void CWE367_TOC_TOU__access_09_bad()
{
if(GLOBAL_CONST_TRUE)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94646/CWE367_TOC_TOU__access_09.c
|
CWE367_TOC_TOU__access_09_bad
|
void CWE367_TOC_TOU__access_09_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
if (GLOBAL_CONST_TRUE != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e5e;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6d;
printLine(&UNK_00401494);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e88;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea2;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb1;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec7;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400eda;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eee;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014a3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400efe;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f0e;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,661
|
void CWE367_TOC_TOU__access_09_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94646/CWE367_TOC_TOU__access_09.c
|
CWE367_TOC_TOU__access_09_good
|
void CWE367_TOC_TOU__access_09_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,662
|
void CWE367_TOC_TOU__access_10_bad()
{
if(globalTrue)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94647/CWE367_TOC_TOU__access_10.c
|
CWE367_TOC_TOU__access_10_bad
|
void CWE367_TOC_TOU__access_10_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
if (globalTrue != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e5e;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6d;
printLine(&UNK_00401494);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e88;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea2;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb1;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec7;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400eda;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eee;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014a3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400efe;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f0e;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,663
|
void CWE367_TOC_TOU__access_10_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94647/CWE367_TOC_TOU__access_10.c
|
CWE367_TOC_TOU__access_10_good
|
void CWE367_TOC_TOU__access_10_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,664
|
void CWE367_TOC_TOU__access_11_bad()
{
if(globalReturnsTrue())
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94648/CWE367_TOC_TOU__access_11.c
|
CWE367_TOC_TOU__access_11_bad
|
void CWE367_TOC_TOU__access_11_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_80 = &UNK_00400dd4;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e62;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e71;
printLine(&UNK_00401494);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e8c;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea6;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb5;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ecb;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ede;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ef2;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014a3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400f02;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f12;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,665
|
void CWE367_TOC_TOU__access_11_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94648/CWE367_TOC_TOU__access_11.c
|
CWE367_TOC_TOU__access_11_good
|
void CWE367_TOC_TOU__access_11_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,666
|
void CWE367_TOC_TOU__access_12_bad()
{
if(globalReturnsTrueOrFalse())
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
else
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FIX: Open the file without checking the status information */
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, GOOD_SINK_STRING, strlen(GOOD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */', '/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FIX: Open the file without checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94649/CWE367_TOC_TOU__access_12.c
|
CWE367_TOC_TOU__access_12_bad
|
void CWE367_TOC_TOU__access_12_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_10;
int iStack_c;
uStack_80 = &UNK_00400dd4;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400fa1;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400fb0;
printLine(&UNK_004015b4);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400fcb;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400fea;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ffd;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00401011;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004015cf,0xc);
if (lVar2 == -1) {
uStack_80 = &UNK_00401021;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00401031;
func_0x00400c10(iStack_c);
}
}
else {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_10 = 0xffffffff;
uStack_80 = &UNK_00400e62;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e71;
printLine(&UNK_004015b4);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e8c;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea6;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb5;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ecb;
iStack_10 = func_0x00400ca0(&uStack_78,2);
if (iStack_10 == -1) {
uStack_80 = &UNK_00400ede;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ef2;
lVar2 = func_0x00400bd0(iStack_10,&UNK_004015c3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400f02;
func_0x00400cc0(1);
}
if (iStack_10 != -1) {
uStack_80 = &UNK_00400f16;
func_0x00400c10(iStack_10);
}
}
return;
}
|
['gcc']
|
52,667
|
void CWE367_TOC_TOU__access_12_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94649/CWE367_TOC_TOU__access_12.c
|
CWE367_TOC_TOU__access_12_good
|
void CWE367_TOC_TOU__access_12_good(void)
{
good1();
return;
}
|
['gcc']
|
52,668
|
void CWE367_TOC_TOU__access_13_bad()
{
if(GLOBAL_CONST_FIVE==5)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94650/CWE367_TOC_TOU__access_13.c
|
CWE367_TOC_TOU__access_13_bad
|
void CWE367_TOC_TOU__access_13_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
if (GLOBAL_CONST_FIVE == 5) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e5f;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6e;
printLine(&UNK_00401494);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e89;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea3;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb2;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec8;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400edb;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eef;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014a3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400eff;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f0f;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,669
|
void CWE367_TOC_TOU__access_13_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94650/CWE367_TOC_TOU__access_13.c
|
CWE367_TOC_TOU__access_13_good
|
void CWE367_TOC_TOU__access_13_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,670
|
void CWE367_TOC_TOU__access_14_bad()
{
if(globalFive==5)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94651/CWE367_TOC_TOU__access_14.c
|
CWE367_TOC_TOU__access_14_bad
|
void CWE367_TOC_TOU__access_14_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
if (globalFive == 5) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e5f;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6e;
printLine(&UNK_00401494);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e89;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea3;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eb2;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec8;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400edb;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eef;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014a3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400eff;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f0f;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,671
|
void CWE367_TOC_TOU__access_14_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94651/CWE367_TOC_TOU__access_14.c
|
CWE367_TOC_TOU__access_14_good
|
void CWE367_TOC_TOU__access_14_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,672
|
void CWE367_TOC_TOU__access_15_bad()
{
switch(6)
{
case 6:
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94652/CWE367_TOC_TOU__access_15.c
|
CWE367_TOC_TOU__access_15_bad
|
void CWE367_TOC_TOU__access_15_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e50;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e5f;
printLine(&UNK_00401484);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e7a;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400e94;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400ea3;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eb9;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ecc;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ee0;
lVar2 = func_0x00400bd0(iStack_c,&UNK_00401493,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400ef0;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f00;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,673
|
void CWE367_TOC_TOU__access_15_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94652/CWE367_TOC_TOU__access_15.c
|
CWE367_TOC_TOU__access_15_good
|
void CWE367_TOC_TOU__access_15_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,674
|
void CWE367_TOC_TOU__access_16_bad()
{
while(1)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
break;
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94653/CWE367_TOC_TOU__access_16.c
|
CWE367_TOC_TOU__access_16_bad
|
void CWE367_TOC_TOU__access_16_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e50;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e5f;
printLine(&UNK_00401484);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e7a;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400e94;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400ea3;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eb9;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ecc;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ee0;
lVar2 = func_0x00400bd0(iStack_c,&UNK_00401493,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400ef0;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f00;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,675
|
void CWE367_TOC_TOU__access_16_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94653/CWE367_TOC_TOU__access_16.c
|
CWE367_TOC_TOU__access_16_good
|
void CWE367_TOC_TOU__access_16_good(void)
{
good1();
return;
}
|
['gcc']
|
52,676
|
void CWE367_TOC_TOU__access_17_bad()
{
int j;
for(j = 0; j < 1; j++)
{
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94654/CWE367_TOC_TOU__access_17.c
|
CWE367_TOC_TOU__access_17_bad
|
void CWE367_TOC_TOU__access_17_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_10;
int iStack_c;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_10 = 0xffffffff;
uStack_80 = &UNK_00400e5c;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e6b;
printLine(&UNK_004014a4);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e86;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400ea0;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400eaf;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ec5;
iStack_10 = func_0x00400ca0(&uStack_78,2);
if (iStack_10 == -1) {
uStack_80 = &UNK_00400ed8;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eec;
lVar2 = func_0x00400bd0(iStack_10,&UNK_004014b3,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400efc;
func_0x00400cc0(1);
}
if (iStack_10 != -1) {
uStack_80 = &UNK_00400f0c;
func_0x00400c10(iStack_10);
}
}
return;
}
|
['gcc']
|
52,677
|
void CWE367_TOC_TOU__access_17_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94654/CWE367_TOC_TOU__access_17.c
|
CWE367_TOC_TOU__access_17_good
|
void CWE367_TOC_TOU__access_17_good(void)
{
good1();
return;
}
|
['gcc']
|
52,678
|
void CWE367_TOC_TOU__access_18_bad()
{
goto sink;
sink:
{
char filename[100] = "";
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (ACCESS(filename, W_OK) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94655/CWE367_TOC_TOU__access_18.c
|
CWE367_TOC_TOU__access_18_bad
|
void CWE367_TOC_TOU__access_18_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_80;
ulong uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
iStack_c = 0xffffffff;
uStack_80 = &UNK_00400e51;
lVar2 = func_0x00400c40(&uStack_78,100,stdin);
if (lVar2 == 0) {
uStack_80 = &UNK_00400e60;
printLine(&UNK_00401484);
uStack_78 = uStack_78 & 0xffffffffffffff00;
}
if ((char)uStack_78 != '\0') {
uStack_80 = &UNK_00400e7b;
lVar2 = func_0x00400bf0(&uStack_78);
*(undefined *)((long)&uStack_80 + lVar2 + 7) = 0;
}
uStack_80 = &UNK_00400e95;
iVar1 = func_0x00400cb0(&uStack_78,2);
if (iVar1 == -1) {
uStack_80 = &UNK_00400ea4;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400eba;
iStack_c = func_0x00400ca0(&uStack_78,2);
if (iStack_c == -1) {
uStack_80 = &UNK_00400ecd;
func_0x00400cc0(1);
}
uStack_80 = &UNK_00400ee1;
lVar2 = func_0x00400bd0(iStack_c,&UNK_00401493,0xb);
if (lVar2 == -1) {
uStack_80 = &UNK_00400ef1;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_80 = &UNK_00400f01;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,679
|
void CWE367_TOC_TOU__access_18_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94655/CWE367_TOC_TOU__access_18.c
|
CWE367_TOC_TOU__access_18_good
|
void CWE367_TOC_TOU__access_18_good(void)
{
good1();
return;
}
|
['gcc']
|
52,680
|
void CWE367_TOC_TOU__stat_01_bad()
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94656/CWE367_TOC_TOU__stat_01.c
|
CWE367_TOC_TOU__stat_01_bad
|
void CWE367_TOC_TOU__stat_01_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e7d;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e8c;
printLine(&UNK_004014e0);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400eb0;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ed5;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ee4;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400efd;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f10;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f24;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ef,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f34;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f44;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,681
|
void CWE367_TOC_TOU__stat_01_good()
{
good1();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94656/CWE367_TOC_TOU__stat_01.c
|
CWE367_TOC_TOU__stat_01_good
|
void CWE367_TOC_TOU__stat_01_good(void)
{
good1();
return;
}
|
['gcc']
|
52,682
|
void CWE367_TOC_TOU__stat_02_bad()
{
if(1)
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94657/CWE367_TOC_TOU__stat_02.c
|
CWE367_TOC_TOU__stat_02_bad
|
void CWE367_TOC_TOU__stat_02_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e7d;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e8c;
printLine(&UNK_004014e0);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400eb0;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ed5;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ee4;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400efd;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f10;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f24;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ef,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f34;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f44;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,683
|
void CWE367_TOC_TOU__stat_02_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94657/CWE367_TOC_TOU__stat_02.c
|
CWE367_TOC_TOU__stat_02_good
|
void CWE367_TOC_TOU__stat_02_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,684
|
void CWE367_TOC_TOU__stat_03_bad()
{
if(5==5)
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94658/CWE367_TOC_TOU__stat_03.c
|
CWE367_TOC_TOU__stat_03_bad
|
void CWE367_TOC_TOU__stat_03_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e7d;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e8c;
printLine(&UNK_004014e0);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400eb0;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ed5;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ee4;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400efd;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f10;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f24;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ef,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f34;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f44;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,685
|
void CWE367_TOC_TOU__stat_03_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94658/CWE367_TOC_TOU__stat_03.c
|
CWE367_TOC_TOU__stat_03_good
|
void CWE367_TOC_TOU__stat_03_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,686
|
void CWE367_TOC_TOU__stat_04_bad()
{
if(STATIC_CONST_TRUE)
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94659/CWE367_TOC_TOU__stat_04.c
|
CWE367_TOC_TOU__stat_04_bad
|
void CWE367_TOC_TOU__stat_04_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e8a;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e99;
printLine(&UNK_004014f8);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400ebd;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ee2;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ef1;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f0a;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f1d;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f31;
lVar2 = func_0x00400bd0(iStack_c,&UNK_00401507,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f41;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f51;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,687
|
void CWE367_TOC_TOU__stat_04_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94659/CWE367_TOC_TOU__stat_04.c
|
CWE367_TOC_TOU__stat_04_good
|
void CWE367_TOC_TOU__stat_04_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,688
|
void CWE367_TOC_TOU__stat_05_bad()
{
if(staticTrue)
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94660/CWE367_TOC_TOU__stat_05.c
|
CWE367_TOC_TOU__stat_05_bad
|
void CWE367_TOC_TOU__stat_05_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
if (staticTrue != 0) {
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e8b;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e9a;
printLine(&UNK_004014f0);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400ebe;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ee3;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ef2;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f0b;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f1e;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f32;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ff,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f42;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f52;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,689
|
void CWE367_TOC_TOU__stat_05_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94660/CWE367_TOC_TOU__stat_05.c
|
CWE367_TOC_TOU__stat_05_good
|
void CWE367_TOC_TOU__stat_05_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,690
|
void CWE367_TOC_TOU__stat_06_bad()
{
if(STATIC_CONST_FIVE==5)
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94661/CWE367_TOC_TOU__stat_06.c
|
CWE367_TOC_TOU__stat_06_bad
|
void CWE367_TOC_TOU__stat_06_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e8b;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e9a;
printLine(&UNK_004014f4);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400ebe;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ee3;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ef2;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f0b;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f1e;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f32;
lVar2 = func_0x00400bd0(iStack_c,&UNK_00401503,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f42;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f52;
func_0x00400c10(iStack_c);
}
return;
}
|
['gcc']
|
52,691
|
void CWE367_TOC_TOU__stat_06_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94661/CWE367_TOC_TOU__stat_06.c
|
CWE367_TOC_TOU__stat_06_good
|
void CWE367_TOC_TOU__stat_06_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,692
|
void CWE367_TOC_TOU__stat_07_bad()
{
if(staticFive==5)
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94662/CWE367_TOC_TOU__stat_07.c
|
CWE367_TOC_TOU__stat_07_bad
|
void CWE367_TOC_TOU__stat_07_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
if (staticFive == 5) {
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e8c;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e9b;
printLine(&UNK_004014f0);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400ebf;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ee4;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ef3;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f0c;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f1f;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f33;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ff,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f43;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f53;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,693
|
void CWE367_TOC_TOU__stat_07_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94662/CWE367_TOC_TOU__stat_07.c
|
CWE367_TOC_TOU__stat_07_good
|
void CWE367_TOC_TOU__stat_07_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,694
|
void CWE367_TOC_TOU__stat_08_bad()
{
if(staticReturnsTrue())
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94663/CWE367_TOC_TOU__stat_08.c
|
CWE367_TOC_TOU__stat_08_bad
|
void CWE367_TOC_TOU__stat_08_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
uStack_120 = &UNK_00400ded;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400ea5;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400eb4;
printLine(&UNK_00401510);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400ed8;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400efd;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400f0c;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f25;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f38;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f4c;
lVar2 = func_0x00400bd0(iStack_c,&UNK_0040151f,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f5c;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f6c;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,695
|
void CWE367_TOC_TOU__stat_08_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94663/CWE367_TOC_TOU__stat_08.c
|
CWE367_TOC_TOU__stat_08_good
|
void CWE367_TOC_TOU__stat_08_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,696
|
void CWE367_TOC_TOU__stat_09_bad()
{
if(GLOBAL_CONST_TRUE)
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94664/CWE367_TOC_TOU__stat_09.c
|
CWE367_TOC_TOU__stat_09_bad
|
void CWE367_TOC_TOU__stat_09_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
if (GLOBAL_CONST_TRUE != 0) {
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e8b;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e9a;
printLine(&UNK_004014f0);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400ebe;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ee3;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ef2;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f0b;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f1e;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f32;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ff,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f42;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f52;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,697
|
void CWE367_TOC_TOU__stat_09_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94664/CWE367_TOC_TOU__stat_09.c
|
CWE367_TOC_TOU__stat_09_good
|
void CWE367_TOC_TOU__stat_09_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
52,698
|
void CWE367_TOC_TOU__stat_10_bad()
{
if(globalTrue)
{
{
char filename[100] = "";
struct STAT statBuffer;
int fileDesc = -1;
if (fgets(filename, 100, stdin) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
filename[0] = '\0';
}
if (strlen(filename) > 0)
{
filename[strlen(filename)-1] = '\0'; /* remove newline */
}
/* FLAW: Open and write to the file after checking the status information */
if (STAT(filename, &statBuffer) == -1)
{
exit(1);
}
fileDesc = OPEN(filename, O_RDWR);
if (fileDesc == -1)
{
exit(1);
}
if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1)
{
exit(1);
}
if (fileDesc != -1)
{
CLOSE(fileDesc);
}
}
}
}
|
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
|
['CWE367']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94665/CWE367_TOC_TOU__stat_10.c
|
CWE367_TOC_TOU__stat_10_bad
|
void CWE367_TOC_TOU__stat_10_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_120;
ulong uStack_118;
undefined8 uStack_110;
undefined8 uStack_108;
undefined8 uStack_100;
undefined8 uStack_f8;
undefined8 uStack_f0;
undefined8 uStack_e8;
undefined8 uStack_e0;
undefined8 uStack_d8;
undefined8 uStack_d0;
undefined8 uStack_c8;
undefined8 uStack_c0;
undefined4 uStack_b8;
undefined auStack_a8 [156];
int iStack_c;
if (globalTrue != 0) {
uStack_118 = 0;
uStack_110 = 0;
uStack_108 = 0;
uStack_100 = 0;
uStack_f8 = 0;
uStack_f0 = 0;
uStack_e8 = 0;
uStack_e0 = 0;
uStack_d8 = 0;
uStack_d0 = 0;
uStack_c8 = 0;
uStack_c0 = 0;
uStack_b8 = 0;
iStack_c = 0xffffffff;
uStack_120 = &UNK_00400e8b;
lVar2 = func_0x00400c40(&uStack_118,100,stdin);
if (lVar2 == 0) {
uStack_120 = &UNK_00400e9a;
printLine(&UNK_004014f0);
uStack_118 = uStack_118 & 0xffffffffffffff00;
}
if ((char)uStack_118 != '\0') {
uStack_120 = &UNK_00400ebe;
lVar2 = func_0x00400bf0(&uStack_118);
*(undefined *)((long)&uStack_120 + lVar2 + 7) = 0;
}
uStack_120 = &UNK_00400ee3;
iVar1 = stat(&uStack_118,auStack_a8);
if (iVar1 == -1) {
uStack_120 = &UNK_00400ef2;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f0b;
iStack_c = func_0x00400cb0(&uStack_118,2);
if (iStack_c == -1) {
uStack_120 = &UNK_00400f1e;
func_0x00400cc0(1);
}
uStack_120 = &UNK_00400f32;
lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ff,0xb);
if (lVar2 == -1) {
uStack_120 = &UNK_00400f42;
func_0x00400cc0(1);
}
if (iStack_c != -1) {
uStack_120 = &UNK_00400f52;
func_0x00400c10(iStack_c);
}
}
return;
}
|
['gcc']
|
52,699
|
void CWE367_TOC_TOU__stat_10_good()
{
good1();
good2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94665/CWE367_TOC_TOU__stat_10.c
|
CWE367_TOC_TOU__stat_10_good
|
void CWE367_TOC_TOU__stat_10_good(void)
{
good1();
good2();
return;
}
|
['gcc']
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.