Integrated: 8341495: JShell crashes with java.util.MissingFormatArgumentException

Archie Cobbs acobbs at openjdk.org
Wed Dec 4 23:19:49 UTC 2024


On Thu, 3 Oct 2024 22:31:04 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> JShell prints some of its output using `printf()` formatted strings. However, there are a few spots where a string `str` to be printed is passed directly as a format string like `format(str)` instead of indirectly like `format("%s", str)`, even though the string `str` contains unknown or arbitrary content outside of JShell's control. As a result, JShell can crash suddenly with a `MissingFormatArgumentException` or similar exception if the string `str` happens to contain a `%` format specifier, etc.
> 
> Please review this patch which attempts to fix the places where an unknown string is passed directly as a format string.

This pull request has now been integrated.

Changeset: bcebb0c5
Author:    Archie Cobbs <acobbs at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/bcebb0c53c1e4629ebde534e237a86c161130fff
Stats:     89 lines in 3 files changed: 61 ins; 0 del; 28 mod

8341495: JShell crashes with java.util.MissingFormatArgumentException

Reviewed-by: jlahoda

-------------

PR: https://git.openjdk.org/jdk/pull/21339


More information about the kulla-dev mailing list