Ver código fonte

core: safety check for finding select final node

(cherry picked from commit 58acedef5a7748310b1032b534c3174f1e3d1a62)
(cherry picked from commit 5f28fd8637f7a0fa1ab866a96fd3564e9c14d7dd)
Daniel-Constantin Mierla 11 anos atrás
pai
commit
62d1d880c8
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      select.c

+ 4 - 0
select.c

@@ -385,6 +385,10 @@ int resolve_select(select_t* s)
 		}
 	}
 
+	if (t==NULL) {
+		BUG ("final node not found\n");
+		goto not_found;
+	}
 	if (t->table[table_idx].flags & SEL_PARAM_EXPECTED) {
 		BUG ("final node has SEL_PARAM_EXPECTED set (no more parameters available)\n");
 		goto not_found;