From 26717c04224fb613f8dfe28f484b8a6f28f3739b Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 1 Mar 2015 16:19:29 +0100 Subject: [PATCH] analyzer: Check the data-type of IN operands. --- src/frontend/analyzer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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: -- 2.30.2