[GRASS-dev] [GRASS GIS] #999: r.mfilter.fp segfaults when divisor is 0

#999: r.mfilter.fp segfaults when divisor is 0
------------------------------+---------------------------------------------
Reporter: juliocc | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: unspecified
Keywords: mfilter segfault | Platform: Unspecified
      Cpu: All |
------------------------------+---------------------------------------------
r.mfilter.fp segfaults when the divisor is 0 because of an error in
getfilt.c.

I'm attaching a patch that fixes this problem.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/999&gt;
GRASS GIS <http://grass.osgeo.org>

#999: r.mfilter.fp segfaults when divisor is 0
--------------------------+-------------------------------------------------
  Reporter: juliocc | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: unspecified
Resolution: | Keywords: mfilter segfault
  Platform: Unspecified | Cpu: All
--------------------------+-------------------------------------------------
Comment (by glynn):

Replying to [ticket:999 juliocc]:
> r.mfilter.fp segfaults when the divisor is 0 because of an error in
getfilt.c.
Fixed in 7.0 with r41431.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/999#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#999: r.mfilter.fp segfaults when divisor is 0
--------------------------+-------------------------------------------------
  Reporter: juliocc | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: unspecified
Resolution: fixed | Keywords: mfilter segfault
  Platform: Unspecified | Cpu: All
--------------------------+-------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * resolution: => fixed

Comment:

Fixed also in 6.4 and 6.5 (r41432 and r41433).

Thanks, juliocc.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/999#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#999: r.mfilter.fp segfaults when divisor is 0
--------------------------+-------------------------------------------------
  Reporter: juliocc | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: unspecified
Resolution: | Keywords: mfilter segfault
  Platform: Unspecified | Cpu: All
--------------------------+-------------------------------------------------
Changes (by marisn):

  * status: closed => reopened
  * resolution: fixed =>

Comment:

This patch breaks 6.4 compilation. There's no "div" in 6.4 and 6.5. Markus
- please revert it.

{{{
grass_64/raster/r.mfilter $ make
gcc -I/home/maris/soft/grass_64/dist.x86_64-unknown-linux-gnu/include -g
-O2 -DPACKAGE=\""grassmods"\" -I/home/maris/soft/grass_64/dist.
x86_64-unknown-linux-gnu/include -o OBJ.x86_64-unknown-linux-gnu/getfilt.o
-c getfilt.c
getfilt.c: In function ‘get_filter’:
getfilt.c:46: warning: format not a string literal and no format arguments
getfilt.c:49: warning: format not a string literal and no format arguments
getfilt.c:71: warning: format not a string literal and no format arguments
getfilt.c:79: warning: format not a string literal and no format arguments
getfilt.c:82: warning: format not a string literal and no format arguments
getfilt.c:87: error: ‘div’ undeclared (first use in this function)
getfilt.c:87: error: (Each undeclared identifier is reported only once
getfilt.c:87: error: for each function it appears in.)
getfilt.c:99: warning: format not a string literal and no format arguments
getfilt.c:105: warning: format not a string literal and no format
arguments
getfilt.c:108: warning: format not a string literal and no format
arguments
getfilt.c:115: warning: format not a string literal and no format
arguments
getfilt.c:122: warning: format not a string literal and no format
arguments
getfilt.c:125: warning: format not a string literal and no format
arguments
getfilt.c:155: warning: format not a string literal and no format
arguments
make: *** [OBJ.x86_64-unknown-linux-gnu/getfilt.o] Error 1
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/999#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#999: r.mfilter.fp segfaults when divisor is 0
--------------------------+-------------------------------------------------
  Reporter: juliocc | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: unspecified
Resolution: | Keywords: mfilter segfault
  Platform: Unspecified | Cpu: All
--------------------------+-------------------------------------------------
Comment (by juliocc):

The patch is against r.mfilter.fp. Revisions r41432, r41433 applied the
patch to r.mfilter

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/999#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#999: r.mfilter.fp segfaults when divisor is 0
--------------------------+-------------------------------------------------
  Reporter: juliocc | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: unspecified
Resolution: | Keywords: mfilter segfault
  Platform: Unspecified | Cpu: All
--------------------------+-------------------------------------------------
Comment (by neteler):

Sorry, done. I was tricked by the different module name.

Reverted previous and really fixed in 6.4 and 6.5 with r41438 and r41440.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/999#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#999: r.mfilter.fp segfaults when divisor is 0
--------------------------+-------------------------------------------------
  Reporter: juliocc | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: unspecified
Resolution: fixed | Keywords: mfilter segfault
  Platform: Unspecified | Cpu: All
--------------------------+-------------------------------------------------
Changes (by juliocc):

  * status: reopened => closed
  * resolution: => fixed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/999#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>