File tree Expand file tree Collapse file tree 5 files changed +50
-0
lines changed
csharp/ql/lib/semmle/code/csharp/dataflow/internal
go/ql/lib/semmle/go/dataflow/internal
python/ql/lib/semmle/python/dataflow/new/internal
ruby/ql/lib/codeql/ruby/dataflow/internal
swift/ql/lib/codeql/swift/dataflow/internal Expand file tree Collapse file tree 5 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -1050,6 +1050,16 @@ module Private {
1050
1050
not exists ( interpretComponent ( c ) )
1051
1051
}
1052
1052
1053
+ /**
1054
+ * Holds if token `part` of specification `spec` has an invalid index.
1055
+ * E.g., `Argument[-1]`.
1056
+ */
1057
+ predicate invalidIndexComponent ( AccessPath spec , AccessPathToken part ) {
1058
+ part = spec .getToken ( _) and
1059
+ part .getName ( ) = [ "Parameter" , "Argument" ] and
1060
+ AccessPath:: parseInt ( part .getArgumentList ( ) ) < 0
1061
+ }
1062
+
1053
1063
private predicate inputNeedsReference ( AccessPathToken c ) {
1054
1064
c .getName ( ) = "Argument" or
1055
1065
inputNeedsReferenceSpecific ( c )
Original file line number Diff line number Diff line change @@ -1050,6 +1050,16 @@ module Private {
1050
1050
not exists ( interpretComponent ( c ) )
1051
1051
}
1052
1052
1053
+ /**
1054
+ * Holds if token `part` of specification `spec` has an invalid index.
1055
+ * E.g., `Argument[-1]`.
1056
+ */
1057
+ predicate invalidIndexComponent ( AccessPath spec , AccessPathToken part ) {
1058
+ part = spec .getToken ( _) and
1059
+ part .getName ( ) = [ "Parameter" , "Argument" ] and
1060
+ AccessPath:: parseInt ( part .getArgumentList ( ) ) < 0
1061
+ }
1062
+
1053
1063
private predicate inputNeedsReference ( AccessPathToken c ) {
1054
1064
c .getName ( ) = "Argument" or
1055
1065
inputNeedsReferenceSpecific ( c )
Original file line number Diff line number Diff line change @@ -1050,6 +1050,16 @@ module Private {
1050
1050
not exists ( interpretComponent ( c ) )
1051
1051
}
1052
1052
1053
+ /**
1054
+ * Holds if token `part` of specification `spec` has an invalid index.
1055
+ * E.g., `Argument[-1]`.
1056
+ */
1057
+ predicate invalidIndexComponent ( AccessPath spec , AccessPathToken part ) {
1058
+ part = spec .getToken ( _) and
1059
+ part .getName ( ) = [ "Parameter" , "Argument" ] and
1060
+ AccessPath:: parseInt ( part .getArgumentList ( ) ) < 0
1061
+ }
1062
+
1053
1063
private predicate inputNeedsReference ( AccessPathToken c ) {
1054
1064
c .getName ( ) = "Argument" or
1055
1065
inputNeedsReferenceSpecific ( c )
Original file line number Diff line number Diff line change @@ -1050,6 +1050,16 @@ module Private {
1050
1050
not exists ( interpretComponent ( c ) )
1051
1051
}
1052
1052
1053
+ /**
1054
+ * Holds if token `part` of specification `spec` has an invalid index.
1055
+ * E.g., `Argument[-1]`.
1056
+ */
1057
+ predicate invalidIndexComponent ( AccessPath spec , AccessPathToken part ) {
1058
+ part = spec .getToken ( _) and
1059
+ part .getName ( ) = [ "Parameter" , "Argument" ] and
1060
+ AccessPath:: parseInt ( part .getArgumentList ( ) ) < 0
1061
+ }
1062
+
1053
1063
private predicate inputNeedsReference ( AccessPathToken c ) {
1054
1064
c .getName ( ) = "Argument" or
1055
1065
inputNeedsReferenceSpecific ( c )
Original file line number Diff line number Diff line change @@ -1050,6 +1050,16 @@ module Private {
1050
1050
not exists ( interpretComponent ( c ) )
1051
1051
}
1052
1052
1053
+ /**
1054
+ * Holds if token `part` of specification `spec` has an invalid index.
1055
+ * E.g., `Argument[-1]`.
1056
+ */
1057
+ predicate invalidIndexComponent ( AccessPath spec , AccessPathToken part ) {
1058
+ part = spec .getToken ( _) and
1059
+ part .getName ( ) = [ "Parameter" , "Argument" ] and
1060
+ AccessPath:: parseInt ( part .getArgumentList ( ) ) < 0
1061
+ }
1062
+
1053
1063
private predicate inputNeedsReference ( AccessPathToken c ) {
1054
1064
c .getName ( ) = "Argument" or
1055
1065
inputNeedsReferenceSpecific ( c )
You can’t perform that action at this time.
0 commit comments