mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Python: broaden search for imports
This now finds vulnerabilities in https://github.com/github/field-security-codeql/issues/100
This commit is contained in:
committed by
yoff
parent
d9854eb409
commit
4f35a62583
@@ -254,9 +254,10 @@ private predicate isNameSpacePackage(Folder f, string name) {
|
||||
legalShortName(name) and
|
||||
name = f.getStem() and
|
||||
not isRegularPackage(f, name) and
|
||||
// it has to be imported in this folder
|
||||
// it has to be imported in a file
|
||||
// either in this folder or next to this folder
|
||||
name =
|
||||
any(ImportExpr i | i.getLocation().getFile().getParent() = f)
|
||||
any(ImportExpr i | i.getLocation().getFile().getParent() in [f, f.getParent()])
|
||||
.getName()
|
||||
.regexpReplaceAll("\\..*", "") and
|
||||
name != "" and
|
||||
|
||||
Reference in New Issue
Block a user