Skip to content

Extapi getenv handling #1680

@mortkever

Description

@mortkever

Hello,

What is the intended handling of external functions like getenv(const char *name)? Currently get_env is annotated as "ALLOC_HEAP_RET" in the new method and as "EFT_NOSTRUCT_ALLOC" in the old method which seem inaccurate. This implies getenv returns a pointer to a newly allocated space on the heap/stack while getenv returns a pointer to the same memory when the argument is the same. So the same argument always returns the same pointer but different arguments return different pointers.

How is SVF supposed to handle functions like these? Would it be okay to annotate getenv as static and just consider all possible returns part of a larger struct, as that seems to be the actual workings of extern char ** environ?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions