From: Sebastian Harl Date: Sun, 1 Mar 2015 15:19:29 +0000 (+0100) Subject: analyzer: Check the data-type of IN operands. X-Git-Tag: sysdb-0.8.0~151 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=26717c04224fb613f8dfe28f484b8a6f28f3739b;p=sysdb.git analyzer: Check the data-type of IN operands. --- diff --git a/src/frontend/analyzer.c b/src/frontend/analyzer.c index 75aa94d..e9e1d13 100644 --- a/src/frontend/analyzer.c +++ b/src/frontend/analyzer.c @@ -268,6 +268,16 @@ analyze_matcher(int context, sdb_store_matcher_t *m, sdb_strbuf_t *errbuf) CMP_M(m)->right->data_type); return -1; } + + if ((CMP_M(m)->left->data_type > 0) + && (CMP_M(m)->right->data_type > 0)) { + if ((CMP_M(m)->left->data_type & 0xff) + != (CMP_M(m)->right->data_type & 0xff)) { + cmp_error(errbuf, m->type, CMP_M(m)->left->data_type, + CMP_M(m)->right->data_type); + return -1; + } + } break; case MATCHER_REGEX: