Integrated: JDK-8285712: LogMessageBuffer doesn't check vsnprintf return value

Johan Sjölén duke at openjdk.java.net
Mon May 2 10:22:42 UTC 2022


On Wed, 27 Apr 2022 10:34:53 GMT, Johan Sjölén <duke at openjdk.java.net> wrote:

> os::vsnprintf can return a negative value on encoding error. A negative return value will cause wraparound when cast to size_t. This in turn causes LogMessageBuffer::grow() to attempt a large memory allocation. Instead of accepting this we bail on the logging.

This pull request has now been integrated.

Changeset: cf81f6cf
Author:    Johan Sjölén <johan.sjolen at oracle.com>
Committer: Thomas Stuefe <stuefe at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/cf81f6cf5bb098575ebce55f19b7c8149203cd71
Stats:     7 lines in 1 file changed: 6 ins; 0 del; 1 mod

8285712: LogMessageBuffer doesn't check vsnprintf return value

Reviewed-by: dholmes, iklam

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

PR: https://git.openjdk.java.net/jdk/pull/8423


More information about the hotspot-runtime-dev mailing list