CWE一覧に戻る
CWE-482

割り当てではなく比較

Comparing instead of Assigning
脆弱性 レビュー中
JA

代入を行うつもりが、比較のために演算子を使用している。

多くの言語では、compare文はassignment文と非常によく似ているので、しばしば混同される。

EN

The code uses an operator for comparison when the intention was to perform an assignment.

In many languages, the compare statement is very close in appearance to the assignment statement; they are often confused.

Scope: Availability, Integrity / Impact: Unexpected State
Many IDEs and static analysis products will detect this problem.
MITRE公式ページ — CWE-482