<dd id="sga4y"><optgroup id="sga4y"></optgroup></dd>
<nav id="sga4y"><code id="sga4y"></code></nav>
  • <optgroup id="sga4y"></optgroup>

    Dead Code

    ABSTRACT

    永遠不會執行該指令。

    EXPLANATION

    周圍的代碼使該指令永遠不會被執行。

    示例:第二個 if 指令的條件不可能得到滿足。這需要變量 s 為非 null 變量,且僅在可以將 s 指定為非 null 值的路徑時,存在 return 指令。


    String s = null;

    if (b) {
    s = "Yes";
    return;
    }

    if (s != null) {
    Dead();
    }

    REFERENCES

    [1] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3050 CAT II

    [2] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3050 CAT II

    [3] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 561


    Copyright 2013 Fortify Software - All rights reserved.
    (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
    desc.internal.cpp.dead_code

    97av