Skip to content

Commit

Permalink
Merge pull request #12855 from MathiasVP/fix-joins-in-use-after-free
Browse files Browse the repository at this point in the history
C++: Fix bad self-join in `cpp/use-after-free`
  • Loading branch information
MathiasVP authored Apr 18, 2023
2 parents 09502c6 + 61aba46 commit fb1a871
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/ql/src/Critical/UseAfterFree.ql
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ module ParameterSinks {
callHasTargetAndArgument(f, i, call, argument) and
initializeParameterInFunction(f, i, p) and
p = getAnAlwaysDereferencedParameter() and
result = pragma[only_bind_out](valueNumber(argument).getAnInstruction()) and
result =
pragma[only_bind_out](pragma[only_bind_into](valueNumber(argument)).getAnInstruction()) and
call = getAnAlwaysReachedCallInstruction(_)
)
}
Expand Down

0 comments on commit fb1a871

Please sign in to comment.