pcloudcc-lneely/tests
Levi Neely b30efe68fb Fix ASAN/LSAN failures: ppath_home stack-use-after-scope + intentional leak
pclsync/ppath.c: Move buff[4096] to function scope in ppath_home() so
the pointer stored in dir via result->pw_dir remains live through the
putil_strdup(dir) call. Previously buff went out of scope at the if-block
close, causing a stack-use-after-scope ASAN report on every call that fell
through the getpwuid_r path.

tests/unit-tests/test_ptools_errptr.c: run_unfixed() intentionally leaks
errPtr to demonstrate the pre-fix bug. Wrap the allocation with
LSAN_DISABLE() / LSAN_ENABLE() so LSAN does not abort the process at exit
before stdio flushes, which was causing a non-zero exit code. The guard
uses nested #ifdef/__has_feature to remain compatible with both GCC
(__SANITIZE_ADDRESS__) and Clang (__has_feature(address_sanitizer))
without triggering "missing binary operator" errors on GCC.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 19:59:33 +01:00
..
fault-inject Fix pcl-zqv.5.7: eliminate deadlock in pfs_get_both_locks (#339) 2026-03-03 19:33:56 +01:00
helpers Fix P1 review findings in pfstasks_db test and helpers 2026-03-10 19:53:16 +01:00
smoke-tests Fix pcl-zqv.5.7: eliminate deadlock in pfs_get_both_locks (#339) 2026-03-03 19:33:56 +01:00
stubs Add GitHub Actions CI workflow for unit tests (#379) 2026-03-10 17:48:42 +01:00
unit-tests Fix ASAN/LSAN failures: ppath_home stack-use-after-scope + intentional leak 2026-03-10 19:59:33 +01:00
test_signal_safety.c Add signal safety test suite (#365) 2026-03-08 12:07:30 +01:00