The logStream::write function takes a char* string and size, accumulating data in _current_line. If the string completes a line (ends with a newline), the configured _log_func is applied to the collected string.
logStream::write is used as the underlying implementation of the log stream formatted printing functions, providing the underlying support for post-formatting accumulation of the output.
However, the _log_func is also a formatting function, taking a char* format string and varargs.
Most of the time, this doesn't matter much; the _log_func just wastes some time looking for format directives in the accumulated output. However, if the output contains "%" characters, they are improperly treated as format directives, with bad results, such as failed assertions or undefined behavior.
logStream::write is used as the underlying implementation of the log stream formatted printing functions, providing the underlying support for post-formatting accumulation of the output.
However, the _log_func is also a formatting function, taking a char* format string and varargs.
Most of the time, this doesn't matter much; the _log_func just wastes some time looking for format directives in the accumulated output. However, if the output contains "%" characters, they are improperly treated as format directives, with bad results, such as failed assertions or undefined behavior.
- relates to
-
JDK-8150079 MSVC prior to VS 2013 doesn't know the 'va_copy' macro
-
- Resolved
-
-
JDK-8147866 Log<>::vwrite could fast-path trivial fmt of "%s"
-
- Closed
-