mirror of
https://github.com/github/codeql.git
synced 2026-01-06 03:00:24 +01:00
avoid reporting empty names in js/exposure-of-private-files
This commit is contained in:
@@ -80,7 +80,11 @@ Folder getAPackageJSONFolder() { result = any(PackageJSON json).getFile().getPar
|
||||
DataFlow::Node getALeakingFolder(string description) {
|
||||
exists(ModuleScope ms | result.asExpr() = ms.getVariable("__dirname").getAnAccess()) and
|
||||
result.getFile().getParentContainer() = getAPackageJSONFolder() and
|
||||
description = "the folder " + result.getFile().getParentContainer().getRelativePath()
|
||||
(
|
||||
if result.getFile().getParentContainer().getRelativePath().trim() != ""
|
||||
then description = "the folder " + result.getFile().getParentContainer().getRelativePath()
|
||||
else description = "a folder"
|
||||
)
|
||||
or
|
||||
result = DataFlow::moduleImport("os").getAMemberCall("homedir") and
|
||||
description = "the home folder"
|
||||
|
||||
Reference in New Issue
Block a user