mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++/ConstantSizeArrayOffByOne
This commit is contained in:
@@ -187,12 +187,14 @@ module ArrayAddressToDerefConfig implements DataFlow::StateConfigSig {
|
||||
predicate observeDiffInformedIncrementalMode() { any() }
|
||||
|
||||
Location getASelectedSourceLocation(DataFlow::Node source) {
|
||||
exists(Variable v | result = v.getLocation() | isSourceImpl(source, v))
|
||||
exists(Variable v | result = v.getLocation() or result = source.getLocation() |
|
||||
isSourceImpl(source, v)
|
||||
)
|
||||
}
|
||||
|
||||
Location getASelectedSinkLocation(DataFlow::Node sink) {
|
||||
exists(PointerArithmeticInstruction pai, Instruction deref |
|
||||
result = [pai, deref].getLocation() and
|
||||
result = [[pai, deref].getLocation(), sink.getLocation()] and
|
||||
isInvalidPointerDerefSink2(sink, deref, _) and
|
||||
isSink(sink, ArrayAddressToDerefConfig::TOverflowArithmetic(pai))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user