From: Evgeny Vereshchagin Date: Sun, 4 Nov 2018 20:43:08 +0000 (+0100) Subject: util: initialize _argtypes in VA_FORMAT_ADVANCE when systemd is built with MSan X-Git-Tag: v240~399^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e180a2516be95f07462348121639bd4d132d305;p=thirdparty%2Fsystemd.git util: initialize _argtypes in VA_FORMAT_ADVANCE when systemd is built with MSan This gets around https://github.com/google/sanitizers/issues/992. --- diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h index 73c03274c71..dc67b6e7613 100644 --- a/src/basic/stdio-util.h +++ b/src/basic/stdio-util.h @@ -7,6 +7,7 @@ #include #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++) { \