fuzz-unit-file: add __has_feature(memory_sanitizer) when skipping ListenNetlink=
https://clang.llvm.org/docs/MemorySanitizer.html#id5 documents this check as the way to detect MemorySanitizer at compilation time. We only need to skip the test if MemorySanitizer is used. Also, use this condition in cg_slice_to_path(). There, the code that is conditionalized is not harmful in any way (it's just unnecessary), so remove the FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION condition. Fixes #8482.
This commit is contained in:
@@ -1976,7 +1976,7 @@ int cg_slice_to_path(const char *unit, char **ret) {
|
||||
_cleanup_free_ char *escaped = NULL;
|
||||
char n[dash - p + sizeof(".slice")];
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
#if HAS_FEATURE_MEMORY_SANITIZER
|
||||
/* msan doesn't instrument stpncpy, so it thinks
|
||||
* n is later used unitialized:
|
||||
* https://github.com/google/sanitizers/issues/926
|
||||
|
||||
Reference in New Issue
Block a user