From 82e16ba248a97e3446d5b2d64c353b61dd6bdda6 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 9 Jan 2025 08:32:09 +0000 Subject: [PATCH] 8347268: [ubsan] logOutput.cpp:357:21: runtime error: applying non-zero offset 1 to null pointer Reviewed-by: dholmes --- src/hotspot/share/logging/logOutput.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/logging/logOutput.cpp b/src/hotspot/share/logging/logOutput.cpp index 17d0e8b555d..6eba01d8aa6 100644 --- a/src/hotspot/share/logging/logOutput.cpp +++ b/src/hotspot/share/logging/logOutput.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -354,7 +354,9 @@ bool LogOutput::parse_options(const char* options, outputStream* errstream) { } break; } - pos = comma_pos + 1; + if (comma_pos != nullptr) { + pos = comma_pos + 1; + } } while (comma_pos != nullptr); os::free(opts);