[GRASS-git] [OSGeo/grass] ba7059: r.geomorphon: Fix an out-of-bounds read w/multires...

Denis Ovsienko noreply at github.com
Mon Sep 28 12:37:55 PDT 2020


  Branch: refs/heads/releasebranch_7_4
  Home:   https://github.com/OSGeo/grass
  Commit: ba7059f77e843cf6975ea68f5c39e0c4615edc7f
      https://github.com/OSGeo/grass/commit/ba7059f77e843cf6975ea68f5c39e0c4615edc7f
  Author: Denis Ovsienko <denis at ovsienko.info>
  Date:   2020-09-28 (Mon, 28 Sep 2020)

  Changed paths:
    M raster/r.geomorphon/main.c

  Log Message:
  -----------
  r.geomorphon: Fix an out-of-bounds read w/multires (#995)

There was a comma missing between array initializers, so the element at
index 3 ended up set to a longer string, and the element at index 4 did
not exist because the array is defined without an explicit size.

This squelches a warning from gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0:

main.c:504:47: warning: iteration 4 invokes undefined behavior
[-Waggressive-loop-optimizations]
  504 |      strcat(multiple_output[i].name, postfixes[i]);
      |                                      ~~~~~~~~~^~~
main.c:501:2: note: within this loop
  501 |  for (i = 0; i < 5; ++i) {
      |  ^~~




More information about the grass-commit mailing list