SVF
SVF copied to clipboard
SVF fails to trace the value flow of the pointer that is transfered to the upper-layer function with a parameter
Hi,sir I wrote a Demo in which a pointer allocated in a function was transfered to the function's caller with its parameter. And ,I found the VFG of the pointer was broken at the callsite which caused a false alarm that the pointer was leaked.So , Dose SVF fail to trace the value flow of the pointer that is transfered to the upper-layer function with a parameter? The demo as following: `void transfptr(int **p) { int p1 = (int)malloc(sizeof(int)); *p = p1; }
int main() { int **p; transfptr(p); free(*p); return 1; }`
Your program is broken. It is supposed that p1 is a pointer type rather than int?
sorry,I got somthing wrong when copying
void transfptr(int **p)
{
int *p1 = (int*)malloc(sizeof(int));
*p = p1;
}
int main()
{
int **p;
transfptr(p);
free(*p);
return 1;
}
p is a null pointer? How could you dereferencing it..
Thanks for your help and sorry for wasting your time,sir . My problem is because of my coding error.