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.
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_envwith minor modifications to build standalone.when running with one arg (e.g.
./test 1) it fires onif (*ptr) ..., and when running with no args (e.g../test) it fires onif (strcmp(ptr, arg0)) ....The gist includes the full output from both runs.