From: Sebastian Harl Date: Tue, 4 Nov 2014 07:34:28 +0000 (+0100) Subject: frontend/analyzer: Check name parameters for FETCH. X-Git-Tag: sysdb-0.6.0~33 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=41888fca9dcd1092f3a4f65d34d5e87b0c39763d;p=sysdb.git frontend/analyzer: Check name parameters for FETCH. --- diff --git a/src/frontend/analyzer.c b/src/frontend/analyzer.c index 8c6b74d..93debf5 100644 --- a/src/frontend/analyzer.c +++ b/src/frontend/analyzer.c @@ -144,9 +144,13 @@ sdb_fe_analyze(sdb_conn_node_t *node) /* For now, this function checks basic matcher attributes only; * later, this may be turned into one of multiple AST visitors. */ if (node->cmd == CONNECTION_FETCH) { - if (CONN_FETCH(node)->filter) - filter = CONN_FETCH(node)->filter->matcher; - context = CONN_FETCH(node)->type; + conn_fetch_t *fetch = CONN_FETCH(node); + if (((fetch->type == SDB_HOST) && fetch->name) + || ((fetch->type != SDB_HOST) && (! fetch->name))) + return -1; + if (fetch->filter) + filter = fetch->filter->matcher; + context = fetch->type; } else if (node->cmd == CONNECTION_LIST) { if (CONN_LIST(node)->filter)