mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
rename getASourceAccess to getAnAliasedSourceNode
This commit is contained in:
@@ -53,7 +53,7 @@ abstract class EnumeratedPropName extends DataFlow::Node {
|
||||
* For example, gets `src[key]` in `for (var key in src) { src[key]; }`.
|
||||
*/
|
||||
PropRead getASourceProp() {
|
||||
result = AccessPath::getASourceAccess(getSourceObject()).getAPropertyRead() and
|
||||
result = AccessPath::getAnAliasedSourceNode(getSourceObject()).getAPropertyRead() and
|
||||
result.getPropertyNameExpr().flow().getImmediatePredecessor*() = this
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ module AccessPath {
|
||||
/**
|
||||
* Gets a SourceNode that is accessed using the same access path as the input.
|
||||
*/
|
||||
DataFlow::SourceNode getASourceAccess(DataFlow::Node node) {
|
||||
DataFlow::SourceNode getAnAliasedSourceNode(DataFlow::Node node) {
|
||||
exists(DataFlow::SourceNode root, string accessPath |
|
||||
node = AccessPath::getAReferenceTo(root, accessPath) and
|
||||
result = AccessPath::getAReferenceTo(root, accessPath)
|
||||
|
||||
@@ -168,7 +168,7 @@ module StringOps {
|
||||
(call.getMethodName() = "substring" or call.getMethodName() = "substr" or call.getMethodName() = "slice") and
|
||||
call.getNumArgument() = 2 and
|
||||
(
|
||||
AccessPath::getASourceAccess(substring).getAPropertyRead("length").flowsTo(call.getArgument(1))
|
||||
AccessPath::getAnAliasedSourceNode(substring).getAPropertyRead("length").flowsTo(call.getArgument(1))
|
||||
or
|
||||
substring.getStringValue().length() = call.getArgument(1).asExpr().getIntValue()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user