<span id="7ztzv"></span>
<sub id="7ztzv"></sub>

<span id="7ztzv"></span><form id="7ztzv"></form>

<span id="7ztzv"></span>

        <address id="7ztzv"></address>

            Portability Flaw: File Separator

            ABSTRACT

            使用硬編碼文件分隔符會導致可移植性問題。

            EXPLANATION

            不同的操作系統使用不同的字符作為文件分隔符。例如,Microsoft Windows 系統使用 "\",而 UNIX 系統則使用 "/"。應用程序需要在不同的平臺上運行時,使用硬編碼文件分隔符會導致應用程序邏輯執行錯誤,并有可能導致 denial of service。



            例 1:以下代碼使用硬編碼文件分隔符來打開文件:


            ...
            os.open(directoryName + "\\" + fileName);
            ...

            REFERENCES

            [1] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 474


            Copyright 2013 Fortify Software - All rights reserved.
            (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
            desc.dataflow.python.portability_flaw_file_separator

            <span id="7ztzv"></span>
            <sub id="7ztzv"></sub>

            <span id="7ztzv"></span><form id="7ztzv"></form>

            <span id="7ztzv"></span>

                  <address id="7ztzv"></address>

                      亚洲欧美在线