github / github/codeql

cpp: how to use macro argument as dataflow sink

オープン
#21,824 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

I would like to do something like this:
```codeql
predicate isSink(DataFlow::Node sink) {
exists(MacroInvocation m |
sink.asExpr() = m.getArgument(0)
and m.getTarget().getName() = "my_cool_macro"
)
}
```
But `getArgument` is not defined, and `getExpandedArgument` returns a string. Doing `sink.asExpr().toString() = m.getExpandedArgument(0)` returns zero matches.

How do I use macros in dataflow?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the CodeQL predicate in the issue and read the mentioned MacroInvocation, getArgument, and getExpandedArgument entry points. Determine how macro arguments can be represented as dataflow nodes, or whether this is unsupported, and document a working example or the limitation so the question has a definitive answer.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
security
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。