[GRASS-SVN] r56456 - grass/trunk/vector/v.reclass

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 28 07:46:02 PDT 2013


Author: mmetz
Date: 2013-05-28 07:46:02 -0700 (Tue, 28 May 2013)
New Revision: 56456

Modified:
   grass/trunk/vector/v.reclass/main.c
Log:
v.reclass: fix segfault if string attribute is NULL

Modified: grass/trunk/vector/v.reclass/main.c
===================================================================
--- grass/trunk/vector/v.reclass/main.c	2013-05-28 13:35:47 UTC (rev 56455)
+++ grass/trunk/vector/v.reclass/main.c	2013-05-28 14:46:02 UTC (rev 56456)
@@ -254,9 +254,9 @@
 		column = db_get_table_column(table, 1);
 		value = db_get_column_value(column);
 
-		if (i == 0 ||
+		if (i == 0 || (!db_test_value_isnull(value) &&
 		    strcmp(db_get_value_string(value),
-			   db_get_string(&lastval)) != 0) {
+			   db_get_string(&lastval)) != 0)) {
 		    newval++;
 		    db_set_string(&lastval, db_get_value_string(value));
 		    G_debug(3, "  newval = %d string = %s", newval,



More information about the grass-commit mailing list