Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e4bfb75

Browse files
author
Dave Bartolomeo
committed
C++: Fix pointer flow through temporary objects
1 parent 1e455f0 commit e4bfb75

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

cpp/ql/src/semmle/code/cpp/dataflow/EscapesTree.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ private predicate pointerToPointerStep(Expr pointerIn, Expr pointerOut) {
8383
or
8484
pointerIn.getConversion() = pointerOut.(ParenthesisExpr)
8585
or
86+
pointerIn.getConversion() = pointerOut.(TemporaryObjectExpr)
87+
or
8688
pointerIn = pointerOut.(ConditionalExpr).getThen().getFullyConverted()
8789
or
8890
pointerIn = pointerOut.(ConditionalExpr).getElse().getFullyConverted()

cpp/ql/src/semmle/code/cpp/dataflow/internal/AddressFlow.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ private predicate pointerToPointerStep(Expr pointerIn, Expr pointerOut) {
8181
or
8282
pointerIn.getConversion() = pointerOut.(ParenthesisExpr)
8383
or
84+
pointerIn.getConversion() = pointerOut.(TemporaryObjectExpr)
85+
or
8486
pointerIn = pointerOut.(ConditionalExpr).getThen().getFullyConverted()
8587
or
8688
pointerIn = pointerOut.(ConditionalExpr).getElse().getFullyConverted()

0 commit comments

Comments
 (0)