diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2018-11-04 21:43:08 +0100 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2018-11-06 19:01:32 +0100 |
commit | 3e180a2516be95f07462348121639bd4d132d305 (patch) | |
tree | bae57ebd8c9e1c2d7aa06c8e5dd828070529701c /src/basic/stdio-util.h | |
parent | 49a060aca840850312bfcc8afecbc84304359bd2 (diff) | |
download | systemd-3e180a2516be95f07462348121639bd4d132d305.tar.gz |
util: initialize _argtypes in VA_FORMAT_ADVANCE when systemd is built with MSan
This gets around https://github.com/google/sanitizers/issues/992.
Diffstat (limited to 'src/basic/stdio-util.h')
-rw-r--r-- | src/basic/stdio-util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h index 73c03274c7..dc67b6e761 100644 --- a/src/basic/stdio-util.h +++ b/src/basic/stdio-util.h @@ -7,6 +7,7 @@ #include <sys/types.h> #include "macro.h" +#include "util.h" #define snprintf_ok(buf, len, fmt, ...) \ ((size_t) snprintf(buf, len, fmt, __VA_ARGS__) < (len)) @@ -18,6 +19,9 @@ do { \ int _argtypes[128]; \ size_t _i, _k; \ + /* See https://github.com/google/sanitizers/issues/992 */ \ + if (HAS_FEATURE_MEMORY_SANITIZER) \ + zero(_argtypes); \ _k = parse_printf_format((format), ELEMENTSOF(_argtypes), _argtypes); \ assert(_k < ELEMENTSOF(_argtypes)); \ for (_i = 0; _i < _k; _i++) { \ |