Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miscutil: Fix dereference invalid iterator #878

Merged

Commits on Dec 12, 2021

  1. miscutil: Fix dereference invalid iterator

    イテレーターを終端チェックする前にデリファレンスしていると
    cppcheck 2.6.2に指摘されたため修正します。
    
    cppcheckのレポート
    ```
    src/jdlib/miscutil.cpp:609:26: warning: Either the condition 'it==list_num.end()' is redundant or there is possible dereference of an invalid iterator: it. [derefInvalidIteratorRedundantCheck]
            const int num = *it;
                             ^
    src/jdlib/miscutil.cpp:610:39: note: Assuming that condition 'it==list_num.end()' is not redundant
            if( num_from + i != num || it == list_num.end() ){
                                          ^
    src/jdlib/miscutil.cpp:609:26: note: Dereference of an invalid iterator
            const int num = *it;
                             ^
    ```
    ma8ma committed Dec 12, 2021
    Copy the full SHA
    377626f View commit details
    Browse the repository at this point in the history