[GRASS-SVN] r73818 - grass/branches/releasebranch_7_6/vector/v.out.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 20 10:50:55 PST 2018


Author: mmetz
Date: 2018-12-20 10:50:55 -0800 (Thu, 20 Dec 2018)
New Revision: 73818

Modified:
   grass/branches/releasebranch_7_6/vector/v.out.ogr/main.c
Log:
v.out.ogr: fix #3714, segfault with -n (backport trunk r73817)

Modified: grass/branches/releasebranch_7_6/vector/v.out.ogr/main.c
===================================================================
--- grass/branches/releasebranch_7_6/vector/v.out.ogr/main.c	2018-12-20 18:50:07 UTC (rev 73817)
+++ grass/branches/releasebranch_7_6/vector/v.out.ogr/main.c	2018-12-20 18:50:55 UTC (rev 73818)
@@ -128,6 +128,7 @@
        Centroids, Boundaries and Kernels always have to be exported
        explicitly, using the "type=" option.
      */
+    field = 0;
     if (!flags.new->answer) {
 	/* open input vector (topology required) */
 	Vect_set_open_level(2);
@@ -189,10 +190,9 @@
 		G_warning(_("Unable to determine input map's vector feature type(s)."));
             }
 	}
+	field = Vect_get_field_number(&In, options.field->answer);
     }
 
-    field = Vect_get_field_number(&In, options.field->answer);
-
     /* check output feature type */
     otype = Vect_option_to_types(options.type);
     ftype = Vect_option_to_types(options.otype);



More information about the grass-commit mailing list