[GRASS-SVN] r65524 - grass/trunk/lib/manage

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 26 14:29:51 PDT 2015


Author: huhabla
Date: 2015-06-26 14:29:51 -0700 (Fri, 26 Jun 2015)
New Revision: 65524

Modified:
   grass/trunk/lib/manage/do_remove.c
Log:
Avoid segfaults in case the mapset name is larger than 50 chars


Modified: grass/trunk/lib/manage/do_remove.c
===================================================================
--- grass/trunk/lib/manage/do_remove.c	2015-06-26 19:12:49 UTC (rev 65523)
+++ grass/trunk/lib/manage/do_remove.c	2015-06-26 21:29:51 UTC (rev 65524)
@@ -97,9 +97,9 @@
     }
 
     if (G_strcasecmp(list[n].element[0], "cell") == 0) {
-	char colr2[50];
+	char colr2[G_MAX_PATH];
 
-	sprintf(colr2, "colr2/%s", G_mapset());
+	G_snprintf(colr2, G_MAX_PATH, "colr2/%s", G_mapset());
 	switch (G_remove(colr2, old)) {
 	case -1:
 	    G_warning(_("Unable to remove %s"), colr2);



More information about the grass-commit mailing list