You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I notice in svf-llvm/lib/extapi.c, the api like getpwuid return STATIC_OBJECT. However, the STATIC_OBJECT is defined as malloc(10), which causes many false positive bug report in real-world projects like nginx.
Would it make more sense to define it as alloca(10) or NULL, since alloca and NULL do not need to be freed. Which may not be reasonable but could reduce false reports of heap object. Or consider modeling it to point to a global object.
We added a new "ALLOC_STACK_RET" annotation in extapi.c (#1616), which allows SVF to allocate a stack object for APIs like getpwuid() based on this annotation.
We added a new "ALLOC_STACK_RET" annotation in extapi.c (#1616), which allows SVF to allocate a stack object for APIs like getpwuid() based on this annotation.
@for-just-we could you try our patch and let us know if it works before we merge it to upstream?
I notice in svf-llvm/lib/extapi.c, the api like
getpwuid
returnSTATIC_OBJECT
. However, theSTATIC_OBJECT
is defined asmalloc(10)
, which causes many false positive bug report in real-world projects like nginx.Would it make more sense to define it as
alloca(10)
orNULL
, sincealloca
andNULL
do not need to be freed. Which may not be reasonable but could reduce false reports of heap object. Or consider modeling it to point to a global object.Here is an example:
The bug report is as follows, which seems to be false positives.
The text was updated successfully, but these errors were encountered: