[GRASS-git] [OSGeo/grass] 7c6c12: v.external: Check for valid list before passing to...

ymdatta noreply at github.com
Mon Sep 9 09:07:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 7c6c12bf98f5bf405372ee692b880d8b295c2177
      https://github.com/OSGeo/grass/commit/7c6c12bf98f5bf405372ee692b880d8b295c2177
  Author: ymdatta <ymdatta.work at gmail.com>
  Date:   2024-09-09 (Mon, 09 Sep 2024)

  Changed paths:
    M vector/v.external/list.c

  Log Message:
  -----------
  v.external: Check for valid list before passing to qsort (#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 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list