Browse Source

v.reclass: fix segfault if string attribute is NULL

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56456 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 năm trước cách đây
mục cha
commit
210f59fb00
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      vector/v.reclass/main.c

+ 2 - 2
vector/v.reclass/main.c

@@ -254,9 +254,9 @@ int main(int argc, char *argv[])
 		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,