浏览代码

i.group segfaults on empty input (fix https://trac.osgeo.org/grass/ticket/1705) (merge https://trac.osgeo.org/grass/changeset/69227 from trunk)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@69229 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 年之前
父节点
当前提交
c04524b9dc
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      imagery/i.group/main.c

+ 4 - 0
imagery/i.group/main.c

@@ -215,6 +215,10 @@ static int add_or_update_group(char group[INAME_LEN], char **rasters, int k)
 
     for (m = 0; m < k; m++) {
 	skip = 0;
+        if (!rasters[m]) {
+            G_warning(_("No input raster maps defined"));
+            return 0;
+        }
 	if ((mapset = G_find_raster(rasters[m], "")) == NULL) {
 	    G_warning(_("Raster map <%s> not found. Skipped."), rasters[m]);
             skip = 1;