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

v.external: Check for valid list before passing to qsort #4280

Merged
merged 1 commit into from
Sep 9, 2024

Commits on Sep 5, 2024

  1. v.external: Check for valid list before passing to qsort

    Currently, if 'HAVE_OGR' macro is defined, as part of execution,
    we order all formats by name using qsort. But, list containing
    all formats is assigned based on a conditional and if the
    conditional fails, it can be NULL.
    
    Behavior of qsort is undefined when a NULL ptr is passed as array
    argument. To avoid getting into that situation, check if the array
    is NULL before performing qsort on it.
    
    This issue was found using cppcheck tool.
    
    Signed-off-by: Mohan Yelugoti <ymdatta.work@gmail.com>
    ymdatta committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    29fedb4 View commit details
    Browse the repository at this point in the history