Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v.external: Check for valid list before passing to qsort (OSGeo#4280)
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>
- Loading branch information