mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Update cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference/InvalidPointerToDereference.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2cfa14b91f
commit
70ac0a5462
@@ -54,7 +54,7 @@
|
||||
* 8. }
|
||||
* ```
|
||||
* this is safe because `p` is guarded to be strictly less than `end` on line 6 before the dereference on line 7. However, if we
|
||||
* run the query on the above without further modifications we'd see an alert on line 7. This is because range analysis infers
|
||||
* run the query on the above without further modifications we would see an alert on line 7. This is because range analysis infers
|
||||
* that `p <= end` after the increment on line 4, and thus the result of `p += 1` is seen as a valid dereference source. This
|
||||
* node then flows to `p` on line 6 (which is a valid dereference sink since it non-strictly upper bounds an address operand), and
|
||||
* range analysis then infers that the address operand of `*p` (i.e., `p`) is non-strictly upper bounded by `p`, and thus reports
|
||||
|
||||
Reference in New Issue
Block a user