[GRASS-git] [OSGeo/grass] 6acffc: lib/vector/Vlib: Fix out-of-scope memory access (#...

Mohan Yelugoti noreply at github.com
Fri Nov 22 17:55:53 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 6acffcb86e76b354ea8a3118d506fc45182ce67a
      https://github.com/OSGeo/grass/commit/6acffcb86e76b354ea8a3118d506fc45182ce67a
  Author: Mohan Yelugoti <ymdatta.work at gmail.com>
  Date:   2024-11-22 (Fri, 22 Nov 2024)

  Changed paths:
    M lib/vector/Vlib/dbcolumns.c

  Log Message:
  -----------
  lib/vector/Vlib: Fix out-of-scope memory access (#4667)

A local array was used to store column name and column
type for each column, and a pointer to this local array
was stored and accessed outside its scope, which can cause
undefined behavior.

To avoid this, use memory from heap to store this information
so that it's accessible outside where its defined and free
this memory at the end to avoid memory leaks.

This 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