Skip to content

Heap buffer underflow in find_argv_from_env #131

@itamaro

Description

@itamaro

When running one of our applications that uses setproctitle under clang ASAN, it detected a heap buffer underflow in find_argv_from_env.

This gist (and this godbolt) demonstrate the issue using a minimal test program that copies find_argv_from_env with minor modifications to build standalone.

when running with one arg (e.g. ./test 1) it fires on if (*ptr) ..., and when running with no args (e.g. ./test) it fires on if (strcmp(ptr, arg0)) ....

The gist includes the full output from both runs.

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