Skip to content

Commit 3b58942

Browse files
committed
Update CdlService getImplementation in CDL.qll
Fixes a regression affecting CodeQL queries for CAP / CDS by ensuring the `getImplementation` predicate of the `CdlService` uses `getAbsolutePath` instead of `getRelativePath`, where the `getRelativePath` approach is problematic in (unit test) cases where the source root directory and project directory are the same.
1 parent 6c4a8fa commit 3b58942

File tree

1 file changed

+2
-2
lines changed
  • javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap

1 file changed

+2
-2
lines changed

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ class CdlService extends CdlElement {
167167
exists(JsonValue jsonFileLocation |
168168
jsonFileLocation = this.getPropValue("$location").getPropValue("file")
169169
|
170-
result.getFile().getRelativePath().regexpReplaceAll("\\.[^.]+$", ".cds") =
170+
result.getFile().getAbsolutePath().regexpReplaceAll("\\.[^.]+$", ".cds") =
171171
jsonFileLocation
172172
.getJsonFile()
173173
.getParentContainer()
174-
.getRelativePath()
174+
.getAbsolutePath()
175175
.regexpReplaceAll("/$", "") + "/" + jsonFileLocation.getStringValue()
176176
)
177177
}

0 commit comments

Comments
 (0)