validate char value length == 1

This commit is contained in:
Doug MacEachern 2007-03-11 22:06:22 +00:00
parent 0ae78b60d9
commit cb4dbce82d
1 changed files with 3 additions and 0 deletions

View File

@ -1114,6 +1114,9 @@ static int ptql_branch_add(ptql_parse_branch_t *parsed,
case PTQL_VALUE_TYPE_CHR:
branch->match.chr = ptql_op_chr[branch->op_name];
if (!is_set) {
if (strlen(parsed->value) != 1) {
return SIGAR_PTQL_MALFORMED_QUERY;
}
branch->value.chr[0] = parsed->value[0];
}
break;