[GRASS-SVN] r53138 - grass/trunk/raster/r.buffer

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 9 03:54:45 PDT 2012


Author: mmetz
Date: 2012-09-09 03:54:45 -0700 (Sun, 09 Sep 2012)
New Revision: 53138

Modified:
   grass/trunk/raster/r.buffer/read_map.c
Log:
r.buffer: fix integer overflow

Modified: grass/trunk/raster/r.buffer/read_map.c
===================================================================
--- grass/trunk/raster/r.buffer/read_map.c	2012-09-09 10:43:39 UTC (rev 53137)
+++ grass/trunk/raster/r.buffer/read_map.c	2012-09-09 10:54:45 UTC (rev 53138)
@@ -36,7 +36,7 @@
     register CELL *cell;
     register MAPTYPE *ptr;
 
-    map = (MAPTYPE *) G_malloc(window.rows * window.cols * sizeof(MAPTYPE));
+    map = (MAPTYPE *) G_malloc((size_t) window.rows * window.cols * sizeof(MAPTYPE));
 
     fd = Rast_open_old(input, mapset);
 



More information about the grass-commit mailing list