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 |
|---|---|---|---|---|---|---|---|---|
47,100 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_02_bad()
{
short data;
/* Initialize data */
data = 0;
if(1)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86479/CWE194_Unexpected_Sign_Extension__fgets_malloc_02.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_02_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_02_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,101 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_02_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86479/CWE194_Unexpected_Sign_Extension__fgets_malloc_02.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_02_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_02_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,102 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_03_bad()
{
short data;
/* Initialize data */
data = 0;
if(5==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86480/CWE194_Unexpected_Sign_Extension__fgets_malloc_03.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_03_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_03_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,103 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_03_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86480/CWE194_Unexpected_Sign_Extension__fgets_malloc_03.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_03_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_03_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,104 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_04_bad()
{
short data;
/* Initialize data */
data = 0;
if(STATIC_CONST_TRUE)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86481/CWE194_Unexpected_Sign_Extension__fgets_malloc_04.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_04_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_04_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_0040135c);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,105 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_04_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86481/CWE194_Unexpected_Sign_Extension__fgets_malloc_04.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_04_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_04_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,106 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_05_bad()
{
short data;
/* Initialize data */
data = 0;
if(staticTrue)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86482/CWE194_Unexpected_Sign_Extension__fgets_malloc_05.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_05_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_05_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
if (staticTrue != 0) {
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,107 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_05_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86482/CWE194_Unexpected_Sign_Extension__fgets_malloc_05.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_05_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_05_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,108 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_06_bad()
{
short data;
/* Initialize data */
data = 0;
if(STATIC_CONST_FIVE==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86483/CWE194_Unexpected_Sign_Extension__fgets_malloc_06.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_06_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_06_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401358);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,109 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_06_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86483/CWE194_Unexpected_Sign_Extension__fgets_malloc_06.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_06_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_06_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,110 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_07_bad()
{
short data;
/* Initialize data */
data = 0;
if(staticFive==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86484/CWE194_Unexpected_Sign_Extension__fgets_malloc_07.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_07_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_07_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
if (staticFive == 5) {
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,111 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_07_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86484/CWE194_Unexpected_Sign_Extension__fgets_malloc_07.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_07_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_07_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,112 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_08_bad()
{
short data;
/* Initialize data */
data = 0;
if(staticReturnsTrue())
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86485/CWE194_Unexpected_Sign_Extension__fgets_malloc_08.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_08_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_08_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_20 = 0;
lVar2 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,113 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_08_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86485/CWE194_Unexpected_Sign_Extension__fgets_malloc_08.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_08_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_08_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,114 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_09_bad()
{
short data;
/* Initialize data */
data = 0;
if(GLOBAL_CONST_TRUE)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86486/CWE194_Unexpected_Sign_Extension__fgets_malloc_09.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_09_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_09_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
if (GLOBAL_CONST_TRUE != 0) {
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,115 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_09_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86486/CWE194_Unexpected_Sign_Extension__fgets_malloc_09.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_09_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_09_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,116 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_10_bad()
{
short data;
/* Initialize data */
data = 0;
if(globalTrue)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86487/CWE194_Unexpected_Sign_Extension__fgets_malloc_10.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_10_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_10_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
if (globalTrue != 0) {
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,117 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_10_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86487/CWE194_Unexpected_Sign_Extension__fgets_malloc_10.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_10_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_10_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,118 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_11_bad()
{
short data;
/* Initialize data */
data = 0;
if(globalReturnsTrue())
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86488/CWE194_Unexpected_Sign_Extension__fgets_malloc_11.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_11_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_11_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
uStack_20 = 0;
lVar2 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401364);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,119 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_11_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86488/CWE194_Unexpected_Sign_Extension__fgets_malloc_11.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_11_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_11_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,120 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_12_bad()
{
short data;
/* Initialize data */
data = 0;
if(globalReturnsTrueOrFalse())
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
else
{
/* FIX: Use a positive integer less than &InitialDataSize&*/
data = 100-1;
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* FIX: Use a positive integer less than &InitialDataSize&*/', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86489/CWE194_Unexpected_Sign_Extension__fgets_malloc_12.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_12_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_12_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
sStack_a = 99;
}
else {
uStack_20 = 0;
lVar2 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401364);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,121 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_12_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86489/CWE194_Unexpected_Sign_Extension__fgets_malloc_12.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_12_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_12_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,122 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_13_bad()
{
short data;
/* Initialize data */
data = 0;
if(GLOBAL_CONST_FIVE==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86490/CWE194_Unexpected_Sign_Extension__fgets_malloc_13.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_13_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_13_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
if (GLOBAL_CONST_FIVE == 5) {
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,123 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_13_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86490/CWE194_Unexpected_Sign_Extension__fgets_malloc_13.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_13_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_13_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,124 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_14_bad()
{
short data;
/* Initialize data */
data = 0;
if(globalFive==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86491/CWE194_Unexpected_Sign_Extension__fgets_malloc_14.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_14_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_14_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
if (globalFive == 5) {
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,125 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_14_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86491/CWE194_Unexpected_Sign_Extension__fgets_malloc_14.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_14_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_14_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,126 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_15_bad()
{
short data;
/* Initialize data */
data = 0;
switch(6)
{
case 6:
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86492/CWE194_Unexpected_Sign_Extension__fgets_malloc_15.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_15_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_15_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,127 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_15_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86492/CWE194_Unexpected_Sign_Extension__fgets_malloc_15.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_15_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_15_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,128 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_16_bad()
{
short data;
/* Initialize data */
data = 0;
while(1)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
break;
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86493/CWE194_Unexpected_Sign_Extension__fgets_malloc_16.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_16_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_16_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,129 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_16_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86493/CWE194_Unexpected_Sign_Extension__fgets_malloc_16.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_16_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_16_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,130 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_17_bad()
{
int i;
short data;
/* Initialize data */
data = 0;
for(i = 0; i < 1; i++)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86494/CWE194_Unexpected_Sign_Extension__fgets_malloc_17.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_17_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_17_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_e;
int iStack_c;
sStack_e = 0;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401364);
}
else {
sStack_e = func_0x00400c20(&uStack_20);
}
}
if (sStack_e < 100) {
lStack_18 = func_0x00400bf0((long)sStack_e);
func_0x00400b80(lStack_18,0x41,(long)(sStack_e + -1));
*(undefined *)(lStack_18 + (long)sStack_e + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,131 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_17_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86494/CWE194_Unexpected_Sign_Extension__fgets_malloc_17.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_17_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_17_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,132 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_18_bad()
{
short data;
/* Initialize data */
data = 0;
goto source;
source:
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86495/CWE194_Unexpected_Sign_Extension__fgets_malloc_18.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_18_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_18_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_a;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_18 + (long)sStack_a + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,133 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_18_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86495/CWE194_Unexpected_Sign_Extension__fgets_malloc_18.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_18_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_18_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,134 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_21_bad()
{
short data;
/* Initialize data */
data = 0;
badStatic = 1; /* true */
data = badSource(data);
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* true */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86496/CWE194_Unexpected_Sign_Extension__fgets_malloc_21.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_21_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_21_bad(void)
{
short sVar1;
long lVar2;
badStatic = 1;
sVar1 = badSource(0);
if (sVar1 < 100) {
lVar2 = func_0x00400bf0((long)sVar1);
func_0x00400b80(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400b40(lVar2);
}
return;
}
| ['gcc'] |
47,135 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_21_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86496/CWE194_Unexpected_Sign_Extension__fgets_malloc_21.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_21_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_21_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,136 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_22_bad()
{
short data;
/* Initialize data */
data = 0;
CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badGlobal = 1; /* true */
data = CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badSource(data);
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* true */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86497/CWE194_Unexpected_Sign_Extension__fgets_malloc_22a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_22_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_22_bad(void)
{
short sVar1;
long lVar2;
CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badGlobal = 1;
sVar1 = CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badSource(0);
if (sVar1 < 100) {
lVar2 = func_0x00400bf0((long)sVar1);
func_0x00400b80(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400b40(lVar2);
}
return;
}
| ['gcc'] |
47,137 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_22_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86497/CWE194_Unexpected_Sign_Extension__fgets_malloc_22a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_22_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_22_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,138 | short CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badSource(short data)
{
if(CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badGlobal)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
return data;
} | ['/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86497/CWE194_Unexpected_Sign_Extension__fgets_malloc_22b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badSource |
undefined2 CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badSource(undefined2 param_1)
{
long lVar1;
undefined2 uStack_1c;
undefined8 uStack_10;
uStack_1c = param_1;
if (CWE194_Unexpected_Sign_Extension__fgets_malloc_22_badGlobal != 0) {
uStack_10 = 0;
lVar1 = func_0x00400bb0(&uStack_10,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401384);
}
else {
uStack_1c = func_0x00400c20(&uStack_10);
}
}
return uStack_1c;
}
| ['gcc'] |
47,139 | short CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B1Source(short data)
{
if(CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Use a positive integer less than &InitialDataSize&*/
data = 100-1;
}
return data;
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Use a positive integer less than &InitialDataSize&*/'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86497/CWE194_Unexpected_Sign_Extension__fgets_malloc_22b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B1Source |
undefined2 CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B1Source(undefined2 param_1)
{
undefined2 uStack_c;
if (CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B1Global == 0) {
uStack_c = 99;
}
else {
printLine(&UNK_00401314);
uStack_c = param_1;
}
return uStack_c;
}
| ['gcc'] |
47,140 | short CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B2Source(short data)
{
if(CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B2Global)
{
/* FIX: Use a positive integer less than &InitialDataSize&*/
data = 100-1;
}
return data;
} | ['/* FIX: Use a positive integer less than &InitialDataSize&*/'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86497/CWE194_Unexpected_Sign_Extension__fgets_malloc_22b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B2Source |
undefined2 CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B2Source(undefined2 param_1)
{
undefined2 uStack_c;
uStack_c = param_1;
if (CWE194_Unexpected_Sign_Extension__fgets_malloc_22_goodG2B2Global != 0) {
uStack_c = 99;
}
return uStack_c;
}
| ['gcc'] |
47,141 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_31_bad()
{
short data;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
{
short dataCopy = data;
short data = dataCopy;
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86498/CWE194_Unexpected_Sign_Extension__fgets_malloc_31.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_31_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_31_bad(void)
{
long lVar1;
undefined8 uStack_20;
long lStack_18;
short sStack_e;
short sStack_c;
short sStack_a;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401364);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
sStack_c = sStack_a;
sStack_e = sStack_a;
if (sStack_a < 100) {
lStack_18 = func_0x00400bf0((long)sStack_a);
func_0x00400b80(lStack_18,0x41,(long)(sStack_e + -1));
*(undefined *)(lStack_18 + (long)sStack_e + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
47,142 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_31_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86498/CWE194_Unexpected_Sign_Extension__fgets_malloc_31.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_31_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_31_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,143 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_32_bad()
{
short data;
short *dataPtr1 = &data;
short *dataPtr2 = &data;
/* Initialize data */
data = 0;
{
short data = *dataPtr1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
*dataPtr1 = data;
}
{
short data = *dataPtr2;
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
}
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86499/CWE194_Unexpected_Sign_Extension__fgets_malloc_32.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_32_bad |
/* WARNING: Restarted to delay deadcode elimination for space: stack */
void CWE194_Unexpected_Sign_Extension__fgets_malloc_32_bad(void)
{
long lVar1;
undefined8 uStack_3a;
short sStack_32;
long lStack_30;
short sStack_22;
short *psStack_20;
short *psStack_18;
short sStack_a;
psStack_18 = &sStack_32;
psStack_20 = &sStack_32;
sStack_32 = 0;
sStack_a = 0;
uStack_3a = 0;
lVar1 = func_0x00400bb0(&uStack_3a,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401384);
}
else {
sStack_a = func_0x00400c20(&uStack_3a);
}
*psStack_18 = sStack_a;
sStack_22 = *psStack_20;
if (sStack_22 < 100) {
lStack_30 = func_0x00400bf0((long)sStack_22);
func_0x00400b80(lStack_30,0x41,(long)(sStack_22 + -1));
*(undefined *)(lStack_30 + (long)sStack_22 + -1) = 0;
printLine(lStack_30);
func_0x00400b40(lStack_30);
}
return;
}
| ['gcc'] |
47,144 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_32_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86499/CWE194_Unexpected_Sign_Extension__fgets_malloc_32.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_32_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_32_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,145 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_41_badSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86502/CWE194_Unexpected_Sign_Extension__fgets_malloc_41.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_41_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_41_badSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400bf0((long)param_1);
func_0x00400b80(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400b40(lVar1);
}
return;
}
| ['gcc'] |
47,146 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_41_bad()
{
short data;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_41_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86502/CWE194_Unexpected_Sign_Extension__fgets_malloc_41.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_41_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_41_bad(void)
{
long lVar1;
undefined8 uStack_12;
short sStack_a;
sStack_a = 0;
uStack_12 = 0;
lVar1 = func_0x00400bb0(&uStack_12,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401374);
}
else {
sStack_a = func_0x00400c20(&uStack_12);
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_41_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,147 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_41_goodG2BSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86502/CWE194_Unexpected_Sign_Extension__fgets_malloc_41.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_41_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_41_goodG2BSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400b00((long)param_1);
func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400a60(lVar1);
}
return;
}
| ['gcc'] |
47,148 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_41_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86502/CWE194_Unexpected_Sign_Extension__fgets_malloc_41.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_41_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_41_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,149 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_42_bad()
{
short data;
/* Initialize data */
data = 0;
data = badSource(data);
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86503/CWE194_Unexpected_Sign_Extension__fgets_malloc_42.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_42_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_42_bad(void)
{
short sVar1;
long lVar2;
sVar1 = badSource(0);
if (sVar1 < 100) {
lVar2 = func_0x00400bf0((long)sVar1);
func_0x00400b80(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400b40(lVar2);
}
return;
}
| ['gcc'] |
47,150 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_42_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86503/CWE194_Unexpected_Sign_Extension__fgets_malloc_42.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_42_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_42_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,151 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_52_bad()
{
short data;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_52b_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86508/CWE194_Unexpected_Sign_Extension__fgets_malloc_52a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_52_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_52_bad(void)
{
long lVar1;
undefined8 uStack_12;
short sStack_a;
sStack_a = 0;
uStack_12 = 0;
lVar1 = func_0x00400bb0(&uStack_12,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401384);
}
else {
sStack_a = func_0x00400c20(&uStack_12);
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_52b_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,152 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_52_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86508/CWE194_Unexpected_Sign_Extension__fgets_malloc_52a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_52_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_52_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,153 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_52b_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86508/CWE194_Unexpected_Sign_Extension__fgets_malloc_52b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_52b_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_52b_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_badSink((int)param_1);
return;
}
| ['gcc'] |
47,154 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_52b_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86508/CWE194_Unexpected_Sign_Extension__fgets_malloc_52b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_52b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_52b_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,155 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_badSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86508/CWE194_Unexpected_Sign_Extension__fgets_malloc_52c.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_badSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400bf0((long)param_1);
func_0x00400b80(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400b40(lVar1);
}
return;
}
| ['gcc'] |
47,156 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_goodG2BSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86508/CWE194_Unexpected_Sign_Extension__fgets_malloc_52c.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_52c_goodG2BSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400b00((long)param_1);
func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400a60(lVar1);
}
return;
}
| ['gcc'] |
47,157 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_53_bad()
{
short data;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_53b_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86509/CWE194_Unexpected_Sign_Extension__fgets_malloc_53a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_53_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_53_bad(void)
{
long lVar1;
undefined8 uStack_12;
short sStack_a;
sStack_a = 0;
uStack_12 = 0;
lVar1 = func_0x00400bb0(&uStack_12,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013a4);
}
else {
sStack_a = func_0x00400c20(&uStack_12);
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_53b_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,158 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_53_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86509/CWE194_Unexpected_Sign_Extension__fgets_malloc_53a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_53_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_53_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,159 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_53b_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86509/CWE194_Unexpected_Sign_Extension__fgets_malloc_53b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_53b_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_53b_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_badSink((int)param_1);
return;
}
| ['gcc'] |
47,160 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_53b_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86509/CWE194_Unexpected_Sign_Extension__fgets_malloc_53b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_53b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_53b_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,161 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86509/CWE194_Unexpected_Sign_Extension__fgets_malloc_53c.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_badSink((int)param_1);
return;
}
| ['gcc'] |
47,162 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86509/CWE194_Unexpected_Sign_Extension__fgets_malloc_53c.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_53c_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,163 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_badSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86509/CWE194_Unexpected_Sign_Extension__fgets_malloc_53d.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_badSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400bf0((long)param_1);
func_0x00400b80(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400b40(lVar1);
}
return;
}
| ['gcc'] |
47,164 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_goodG2BSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86509/CWE194_Unexpected_Sign_Extension__fgets_malloc_53d.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_53d_goodG2BSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400b00((long)param_1);
func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400a60(lVar1);
}
return;
}
| ['gcc'] |
47,165 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54_bad()
{
short data;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_54b_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54_bad(void)
{
long lVar1;
undefined8 uStack_12;
short sStack_a;
sStack_a = 0;
uStack_12 = 0;
lVar1 = func_0x00400bb0(&uStack_12,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013c4);
}
else {
sStack_a = func_0x00400c20(&uStack_12);
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_54b_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,166 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,167 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54b_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54b_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54b_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_badSink((int)param_1);
return;
}
| ['gcc'] |
47,168 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54b_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54b_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,169 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54c.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_badSink((int)param_1);
return;
}
| ['gcc'] |
47,170 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54c.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54c_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,171 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54d.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_badSink((int)param_1);
return;
}
| ['gcc'] |
47,172 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54d.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54d_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,173 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_badSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54e.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_badSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400bf0((long)param_1);
func_0x00400b80(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400b40(lVar1);
}
return;
}
| ['gcc'] |
47,174 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_goodG2BSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86510/CWE194_Unexpected_Sign_Extension__fgets_malloc_54e.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_54e_goodG2BSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400b00((long)param_1);
func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400a60(lVar1);
}
return;
}
| ['gcc'] |
47,175 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_61_bad()
{
short data;
/* Initialize data */
data = 0;
data = CWE194_Unexpected_Sign_Extension__fgets_malloc_61b_badSource(data);
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86511/CWE194_Unexpected_Sign_Extension__fgets_malloc_61a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_61_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_61_bad(void)
{
short sVar1;
long lVar2;
sVar1 = CWE194_Unexpected_Sign_Extension__fgets_malloc_61b_badSource(0);
if (sVar1 < 100) {
lVar2 = func_0x00400bf0((long)sVar1);
func_0x00400b80(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400b40(lVar2);
}
return;
}
| ['gcc'] |
47,176 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_61_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86511/CWE194_Unexpected_Sign_Extension__fgets_malloc_61a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_61_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_61_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,177 | short CWE194_Unexpected_Sign_Extension__fgets_malloc_61b_badSource(short data)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
return data;
} | ['/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86511/CWE194_Unexpected_Sign_Extension__fgets_malloc_61b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_61b_badSource |
undefined2 CWE194_Unexpected_Sign_Extension__fgets_malloc_61b_badSource(undefined2 param_1)
{
long lVar1;
undefined2 uStack_1c;
undefined8 uStack_10;
uStack_10 = 0;
lVar1 = func_0x00400bb0(&uStack_10,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401374);
uStack_1c = param_1;
}
else {
uStack_1c = func_0x00400c20(&uStack_10);
}
return uStack_1c;
}
| ['gcc'] |
47,178 | short CWE194_Unexpected_Sign_Extension__fgets_malloc_61b_goodG2BSource(short data)
{
/* FIX: Use a positive integer less than &InitialDataSize&*/
data = 100-1;
return data;
} | ['/* FIX: Use a positive integer less than &InitialDataSize&*/'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86511/CWE194_Unexpected_Sign_Extension__fgets_malloc_61b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_61b_goodG2BSource |
undefined2 CWE194_Unexpected_Sign_Extension__fgets_malloc_61b_goodG2BSource(void)
{
return 99;
}
| ['gcc'] |
47,179 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_63_bad()
{
short data;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_63b_badSink(&data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86513/CWE194_Unexpected_Sign_Extension__fgets_malloc_63a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_63_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_63_bad(void)
{
long lVar1;
undefined8 uStack_12;
undefined2 uStack_a;
uStack_a = 0;
uStack_12 = 0;
lVar1 = func_0x00400bb0(&uStack_12,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401374);
}
else {
uStack_a = func_0x00400c20(&uStack_12);
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_63b_badSink(&uStack_a);
return;
}
| ['gcc'] |
47,180 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_63_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86513/CWE194_Unexpected_Sign_Extension__fgets_malloc_63a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_63_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_63_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,181 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_63b_badSink(short * dataPtr)
{
short data = *dataPtr;
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86513/CWE194_Unexpected_Sign_Extension__fgets_malloc_63b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_63b_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_63b_badSink(short *param_1)
{
short sVar1;
long lVar2;
sVar1 = *param_1;
if (sVar1 < 100) {
lVar2 = func_0x00400bf0((long)sVar1);
func_0x00400b80(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400b40(lVar2);
}
return;
}
| ['gcc'] |
47,182 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_63b_goodG2BSink(short * dataPtr)
{
short data = *dataPtr;
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86513/CWE194_Unexpected_Sign_Extension__fgets_malloc_63b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_63b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_63b_goodG2BSink(short *param_1)
{
short sVar1;
long lVar2;
sVar1 = *param_1;
if (sVar1 < 100) {
lVar2 = func_0x00400b00((long)sVar1);
func_0x00400aa0(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400a60(lVar2);
}
return;
}
| ['gcc'] |
47,183 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_64_bad()
{
short data;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_64b_badSink(&data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86514/CWE194_Unexpected_Sign_Extension__fgets_malloc_64a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_64_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_64_bad(void)
{
long lVar1;
undefined8 uStack_12;
undefined2 uStack_a;
uStack_a = 0;
uStack_12 = 0;
lVar1 = func_0x00400bb0(&uStack_12,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401384);
}
else {
uStack_a = func_0x00400c20(&uStack_12);
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_64b_badSink(&uStack_a);
return;
}
| ['gcc'] |
47,184 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_64_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86514/CWE194_Unexpected_Sign_Extension__fgets_malloc_64a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_64_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_64_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,185 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_64b_badSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
short * dataPtr = (short *)dataVoidPtr;
/* dereference dataPtr into data */
short data = (*dataPtr);
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86514/CWE194_Unexpected_Sign_Extension__fgets_malloc_64b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_64b_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_64b_badSink(short *param_1)
{
short sVar1;
long lVar2;
sVar1 = *param_1;
if (sVar1 < 100) {
lVar2 = func_0x00400bf0((long)sVar1);
func_0x00400b80(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400b40(lVar2);
}
return;
}
| ['gcc'] |
47,186 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_64b_goodG2BSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
short * dataPtr = (short *)dataVoidPtr;
/* dereference dataPtr into data */
short data = (*dataPtr);
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86514/CWE194_Unexpected_Sign_Extension__fgets_malloc_64b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_64b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_64b_goodG2BSink(short *param_1)
{
short sVar1;
long lVar2;
sVar1 = *param_1;
if (sVar1 < 100) {
lVar2 = func_0x00400b00((long)sVar1);
func_0x00400aa0(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400a60(lVar2);
}
return;
}
| ['gcc'] |
47,187 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_65_bad()
{
short data;
/* define a function pointer */
void (*funcPtr) (short) = CWE194_Unexpected_Sign_Extension__fgets_malloc_65b_badSink;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* use the function pointer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86515/CWE194_Unexpected_Sign_Extension__fgets_malloc_65a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_65_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_65_bad(void)
{
long lVar1;
undefined8 uStack_20;
code *pcStack_18;
short sStack_a;
pcStack_18 = CWE194_Unexpected_Sign_Extension__fgets_malloc_65b_badSink;
sStack_a = 0;
uStack_20 = 0;
lVar1 = func_0x00400bb0(&uStack_20,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401374);
}
else {
sStack_a = func_0x00400c20(&uStack_20);
}
(*pcStack_18)((int)sStack_a);
return;
}
| ['gcc'] |
47,188 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_65_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86515/CWE194_Unexpected_Sign_Extension__fgets_malloc_65a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_65_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_65_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,189 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_65b_badSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86515/CWE194_Unexpected_Sign_Extension__fgets_malloc_65b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_65b_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_65b_badSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400bf0((long)param_1);
func_0x00400b80(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400b40(lVar1);
}
return;
}
| ['gcc'] |
47,190 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_65b_goodG2BSink(short data)
{
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86515/CWE194_Unexpected_Sign_Extension__fgets_malloc_65b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_65b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_65b_goodG2BSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400b00((long)param_1);
func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400a60(lVar1);
}
return;
}
| ['gcc'] |
47,191 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_66_bad()
{
short data;
short dataArray[5];
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
/* put data in array */
dataArray[2] = data;
CWE194_Unexpected_Sign_Extension__fgets_malloc_66b_badSink(dataArray);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */', '/* put data in array */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86516/CWE194_Unexpected_Sign_Extension__fgets_malloc_66a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_66_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_66_bad(void)
{
long lVar1;
undefined8 uStack_1c;
undefined auStack_14 [4];
undefined2 uStack_10;
undefined2 uStack_a;
uStack_a = 0;
uStack_1c = 0;
lVar1 = func_0x00400bb0(&uStack_1c,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401384);
}
else {
uStack_a = func_0x00400c20(&uStack_1c);
}
uStack_10 = uStack_a;
CWE194_Unexpected_Sign_Extension__fgets_malloc_66b_badSink(auStack_14);
return;
}
| ['gcc'] |
47,192 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_66_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86516/CWE194_Unexpected_Sign_Extension__fgets_malloc_66a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_66_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_66_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,193 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_66b_badSink(short dataArray[])
{
/* copy data out of dataArray */
short data = dataArray[2];
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* copy data out of dataArray */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86516/CWE194_Unexpected_Sign_Extension__fgets_malloc_66b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_66b_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_66b_badSink(long param_1)
{
short sVar1;
long lVar2;
sVar1 = *(short *)(param_1 + 4);
if (sVar1 < 100) {
lVar2 = func_0x00400bf0((long)sVar1);
func_0x00400b80(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400b40(lVar2);
}
return;
}
| ['gcc'] |
47,194 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_66b_goodG2BSink(short dataArray[])
{
short data = dataArray[2];
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86516/CWE194_Unexpected_Sign_Extension__fgets_malloc_66b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_66b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_66b_goodG2BSink(long param_1)
{
short sVar1;
long lVar2;
sVar1 = *(short *)(param_1 + 4);
if (sVar1 < 100) {
lVar2 = func_0x00400b00((long)sVar1);
func_0x00400aa0(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400a60(lVar2);
}
return;
}
| ['gcc'] |
47,195 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_67_bad()
{
short data;
CWE194_Unexpected_Sign_Extension__fgets_malloc_67_structType myStruct;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
myStruct.structFirst = data;
CWE194_Unexpected_Sign_Extension__fgets_malloc_67b_badSink(myStruct);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86517/CWE194_Unexpected_Sign_Extension__fgets_malloc_67a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_67_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_67_bad(void)
{
long lVar1;
undefined8 uStack_14;
undefined2 uStack_c;
undefined2 uStack_a;
uStack_a = 0;
uStack_14 = 0;
lVar1 = func_0x00400bb0(&uStack_14,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401374);
}
else {
uStack_a = func_0x00400c20(&uStack_14);
}
uStack_c = uStack_a;
CWE194_Unexpected_Sign_Extension__fgets_malloc_67b_badSink(uStack_a);
return;
}
| ['gcc'] |
47,196 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_67_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86517/CWE194_Unexpected_Sign_Extension__fgets_malloc_67a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_67_good |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_67_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,197 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_67b_badSink(CWE194_Unexpected_Sign_Extension__fgets_malloc_67_structType myStruct)
{
short data = myStruct.structFirst;
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86517/CWE194_Unexpected_Sign_Extension__fgets_malloc_67b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_67b_badSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_67b_badSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400bf0((long)param_1);
func_0x00400b80(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400b40(lVar1);
}
return;
}
| ['gcc'] |
47,198 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_67b_goodG2BSink(CWE194_Unexpected_Sign_Extension__fgets_malloc_67_structType myStruct)
{
short data = myStruct.structFirst;
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86517/CWE194_Unexpected_Sign_Extension__fgets_malloc_67b.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_67b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_67b_goodG2BSink(short param_1)
{
long lVar1;
if (param_1 < 100) {
lVar1 = func_0x00400b00((long)param_1);
func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1));
*(undefined *)(lVar1 + (long)param_1 + -1) = 0;
printLine(lVar1);
func_0x00400a60(lVar1);
}
return;
}
| ['gcc'] |
47,199 | void CWE194_Unexpected_Sign_Extension__fgets_malloc_68_bad()
{
short data;
/* Initialize data */
data = 0;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* FLAW: Use a value input from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to short */
data = (short)atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_68_badData = data;
CWE194_Unexpected_Sign_Extension__fgets_malloc_68b_badSink();
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fgets() */', '/* Convert to short */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86518/CWE194_Unexpected_Sign_Extension__fgets_malloc_68a.c | CWE194_Unexpected_Sign_Extension__fgets_malloc_68_bad |
void CWE194_Unexpected_Sign_Extension__fgets_malloc_68_bad(void)
{
long lVar1;
undefined8 uStack_12;
undefined2 uStack_a;
uStack_a = 0;
uStack_12 = 0;
lVar1 = func_0x00400bb0(&uStack_12,8,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401374);
}
else {
uStack_a = func_0x00400c20(&uStack_12);
}
CWE194_Unexpected_Sign_Extension__fgets_malloc_68_badData = uStack_a;
CWE194_Unexpected_Sign_Extension__fgets_malloc_68b_badSink();
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.