From c484d8904285652246c3af212a4211b9a8955149 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 16 Mar 2021 05:49:01 +0000 Subject: [PATCH] 8263557: Possible NULL dereference in Arena::destruct_contents() Reviewed-by: kbarrett, coleenp --- src/hotspot/share/memory/arena.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/memory/arena.cpp b/src/hotspot/share/memory/arena.cpp index 8388f68c359..16059bed9be 100644 --- a/src/hotspot/share/memory/arena.cpp +++ b/src/hotspot/share/memory/arena.cpp @@ -310,7 +310,9 @@ void Arena::destruct_contents() { // reset size before chop to avoid a rare racing condition // that can have total arena memory exceed total chunk memory set_size_in_bytes(0); - _first->chop(); + if (_first != NULL) { + _first->chop(); + } reset(); } -- 2.31.1