From 933c7fa836db9e0280ed53769342680dce7cb061 Mon Sep 17 00:00:00 2001 From: Andrea Marziali Date: Thu, 12 Dec 2024 13:54:48 +0100 Subject: [PATCH] enforce checks --- .../trace/instrumentation/liberty20/BundleNameHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dd-java-agent/instrumentation/liberty-20/src/main/java/datadog/trace/instrumentation/liberty20/BundleNameHelper.java b/dd-java-agent/instrumentation/liberty-20/src/main/java/datadog/trace/instrumentation/liberty20/BundleNameHelper.java index f00e285cc54..6acbed6647b 100644 --- a/dd-java-agent/instrumentation/liberty-20/src/main/java/datadog/trace/instrumentation/liberty20/BundleNameHelper.java +++ b/dd-java-agent/instrumentation/liberty-20/src/main/java/datadog/trace/instrumentation/liberty20/BundleNameHelper.java @@ -13,7 +13,7 @@ public static String extractDeploymentName(final ThreadContextClassLoader classL return null; } final int tail = id.lastIndexOf('#'); - if (tail < 0) { + if (tail <= head) { return null; } return id.substring(head + 1, tail);