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

    Obsolete: Inadequate Pointer Validation

    ABSTRACT

    函數已過時,不能保證指針是有效的,或引用的內存可以安全使用。

    EXPLANATION

    不使用 IsBadXXXPtr() 類的函數有多種原因。這些函數是:
    1) 非線程安全的。
    2) 通常與由于其探測無效內存地址而導致的崩潰有關。
    3) 被錯誤地認為在異常條件中執行正確的錯誤處理。

    例:以下代碼使用 IsBadWritePtr() 嘗試避免錯誤的內存寫入。


    if (IsBadWritePtr(ptr, length))
    {
    [handle error]
    }


    程序員原本希望使用這些函數來檢測異常情況,但它們通常導致更多無法修復的問題。

    REFERENCES

    [1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A9 Application Denial of Service

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

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

    [4] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 730

    [5] IsBadWritePtr Function Microsoft

    [6] Raymond Chen IsBadXxxPtr should really be called CrashProgramRandomly

    [7] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.9


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

    97av