From a7c32b538deb754219ca0d347e8695c24bb59584 Mon Sep 17 00:00:00 2001 From: Al Arafat Tanin | rng70-or Date: Sun, 24 Mar 2024 13:15:52 +0600 Subject: [PATCH] fix: possible null pointer dereference --- .../google/devtools/build/lib/rules/cpp/LinkCommandLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java index 48946b5c6be6c6..4ad3b688fb0298 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java @@ -891,7 +891,7 @@ private void addDynamicInputLinkOptions(LinkerInput input, List options, Artifact inputArtifact = input.getArtifact(); PathFragment libDir = inputArtifact.getExecPath().getParentDirectory(); if (rpathRoot != null - && !libDir.equals(solibDir) + && !solibDir.equals(libDir) && (runtimeSolibDir == null || !runtimeSolibDir.equals(libDir))) { String dotdots = ""; PathFragment commonParent = solibDir;