[GRASS-git] [OSGeo/grass] 4564a0: lib/arraystats: re-enable "Discont" algorithm (#5529)

Nicklas Larsson noreply at github.com
Wed Apr 23 12:58:41 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 4564a0992b831c93784c00ecceb727232940f69b
      https://github.com/OSGeo/grass/commit/4564a0992b831c93784c00ecceb727232940f69b
  Author: Nicklas Larsson <n_larsson at yahoo.com>
  Date:   2025-04-23 (Wed, 23 Apr 2025)

  Changed paths:
    M display/d.vect.thematic/main.c
    M include/grass/defs/arraystats.h
    M lib/arraystats/basic.c
    M lib/arraystats/class.c
    M vector/v.class/main.c

  Log Message:
  -----------
  lib/arraystats: re-enable "Discont" algorithm (#5529)

Addresses heap buffer overflow in previously disabled 'Discont'
algorithm.

The immediate cause was too small allocation of variable `num` in
`AS_class_discont()`, which was fixed by an increase of its size
(broadly mirroring the original Fortran code).

This fix was complemented by some code related improvements:

- Code clean up and restructure of `AS_class_discont()`
- Re-enable "dis" algorithm in v.class and d.vect.thematic
- Remove realloc of classbreak, which wasn’t necessary and
  would need complicated solution to work

See: https://lists.osgeo.org/pipermail/grass-dev/2008-July/038951.html

Fixes: https://github.com/OSGeo/grass/issues/5486



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