diff --git xmlschemas.c.orig xmlschemas.c
index 796e0edf42a90ad4cce503ce04dc2c00bd5ddaad..6a678ce7df4f9ad9aefc9e649764177b5fd9a172 100644
--- xmlschemas.c
+++ xmlschemas.c
@@ -23336,7 +23336,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
 			j++;
 		    } while (j < nbDupls);
 		}
-		if (nbNodeTable) {
+		if (bind->nbNodes) {
 		    j = 0;
 		    do {
 			if (nbFields == 1) {
@@ -23387,7 +23387,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
 
 next_node_table_entry:
 			j++;
-		    } while (j < nbNodeTable);
+		    } while (j < bind->nbNodes);
 		}
 		/*
 		* If everything is fine, then add the IDC target-node to
