test sample
Browse files- mvd_decomp.csv +48 -0
mvd_decomp.csv
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
source_code,comments,label,function,decompiled_code,compiler_options
|
| 2 |
+
"void CWE690_NULL_Deref_From_Return__int_malloc_32_bad()
|
| 3 |
+
{
|
| 4 |
+
int * data;
|
| 5 |
+
int * *dataPtr1 = &data;
|
| 6 |
+
int * *dataPtr2 = &data;
|
| 7 |
+
data = NULL; /* Initialize data */
|
| 8 |
+
{
|
| 9 |
+
int * data = *dataPtr1;
|
| 10 |
+
/* POTENTIAL FLAW: Allocate memory without checking if the memory allocation function failed */
|
| 11 |
+
data = (int *)malloc(1*sizeof(int));
|
| 12 |
+
*dataPtr1 = data;
|
| 13 |
+
}
|
| 14 |
+
{
|
| 15 |
+
int * data = *dataPtr2;
|
| 16 |
+
/* FLAW: Initialize memory buffer without checking to see if the memory allocation function failed */
|
| 17 |
+
data[0] = 5;
|
| 18 |
+
printIntLine(data[0]);
|
| 19 |
+
free(data);
|
| 20 |
+
}
|
| 21 |
+
}","['/* Initialize data */'
|
| 22 |
+
'/* POTENTIAL FLAW: Allocate memory without checking if the memory allocation function failed */'
|
| 23 |
+
'/* FLAW: Initialize memory buffer without checking to see if the memory allocation function failed */']",['CWE690'],CWE690_NULL_Deref_From_Return__int_malloc_32_bad,"
|
| 24 |
+
/* WARNING: Restarted to delay deadcode elimination for space: stack */
|
| 25 |
+
|
| 26 |
+
void CWE690_NULL_Deref_From_Return__int_malloc_32_bad(void)
|
| 27 |
+
|
| 28 |
+
{
|
| 29 |
+
undefined8 uStack_30;
|
| 30 |
+
undefined4 *puStack_28;
|
| 31 |
+
undefined8 uStack_20;
|
| 32 |
+
undefined8 *puStack_18;
|
| 33 |
+
undefined8 *puStack_10;
|
| 34 |
+
|
| 35 |
+
puStack_10 = &uStack_30;
|
| 36 |
+
puStack_18 = &uStack_30;
|
| 37 |
+
uStack_30 = 0;
|
| 38 |
+
uStack_20 = 0;
|
| 39 |
+
uStack_20 = func_0x00400ab0(4);
|
| 40 |
+
*puStack_10 = uStack_20;
|
| 41 |
+
puStack_28 = (undefined4 *)*puStack_18;
|
| 42 |
+
*puStack_28 = 5;
|
| 43 |
+
printIntLine(*puStack_28);
|
| 44 |
+
func_0x00400a20(puStack_28);
|
| 45 |
+
return;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
",['gcc' '-O0']
|