Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93a773c

Browse files
Add comments where intention was unclear
1 parent6ad3660 commit93a773c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

‎c/cert/src/rules/CON34-C/AppropriateThreadObjectStorageDurations.ql‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ where
3939
)
4040
)
4141
or
42-
// TODO: Remove/replace with tss_t type check, see #801.
42+
// TODO: This case is handling threadlocals in a useful way that's not intended to be covered
43+
// by the rule. See issue #801. The actual rule should expect no tss_t objects is used, and
44+
// this check that this is initialized doesn't seem to belong here. However, it is a useful
45+
// check in and of itself, so we should figure out if this is part of an optional rule we
46+
// haven't yet implemented and move this behavior there.
4347
exists(TSSGetFunctionCalltsg|
4448
TaintTracking::localTaint(DataFlow::exprNode(tsg), DataFlow::exprNode(arg))and
4549
notexists(TSSSetFunctionCalltss, DataFlow::Nodesrc|

‎c/common/src/codingstandards/c/Objects.qll‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,14 @@ abstract class ObjectIdentityBase extends Element {
106106
exists(Exprsubobject|
107107
subobject=getASubobjectAccess()and
108108
(
109+
// Holds for address-of expressions.
109110
result=any(AddressOfExpre|e.getOperand()=subobject)
110111
or
112+
// Holds for array-to-pointer conversions, which evaluate to a usable subobject address.
111113
exists(ArrayToPointerConversionc|c.getExpr()=subobject)and
114+
// Note that `arr[x]` has an array-to-pointer conversion, and returns the `x`th item by
115+
// value, not the address of the `x`th item. Therefore, exclude `arr` if `arr` is part of
116+
// an expression `arr[x]`.
112117
notexists(ArrayExpra|a.getArrayBase()=subobject)and
113118
result=subobject
114119
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp