[GRASS-git] [OSGeo/grass] 76507c: v.generalize: Initialize all of structure contents...

ymdatta noreply at github.com
Tue Sep 10 02:59:32 PDT 2024


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

  Changed paths:
    M vector/v.generalize/smoothing.c

  Log Message:
  -----------
  v.generalize: Initialize all of structure contents before using it (#4281)

* v.generalize: Initialize all of structure contents before using it

Currently, in `head` which is a `POINT_LIST` structure, we are
only initializing the next pointer to NULL, but data present
in the point substructure is not initialized which implies that
it would be filled with random data. To avoid such scenario,
initialize point coordinates to zero.

This was found using cppcheck tool.

Signed-off-by: Mohan Yelugoti <ymdatta.work at gmail.com>

* Use correct literal for double type

Co-authored-by: Nicklas Larsson <n_larsson at yahoo.com>

---------

Signed-off-by: Mohan Yelugoti <ymdatta.work at gmail.com>
Co-authored-by: Nicklas Larsson <n_larsson at yahoo.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