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

lib/vector/vlib: Fix possible null pointer dereference #4638

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 2, 2024

  1. lib:vector:vlib: Fix possible null pointer dereference

    In the function `Vect_cat_list_to_array`, as part of the
    execution, if list turns out to not contain any numbers,
    `cats` internal variable is not changed from NULL. Without
    checking if `cats` is NULL or not, qsort or first elemnt of
    it is accessed, which can lead to null pointer dereference.
    
    To fix that issue, only access cats if it's not NULL.
    
    This issue was found using cppcheck tool.
    
    Signed-off-by: Mohan Yelugoti <[email protected]>
    ymdatta committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    1d5e652 View commit details
    Browse the repository at this point in the history