diff options
Diffstat (limited to 'src/tsg_rule.cpp')
| -rw-r--r-- | src/tsg_rule.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 7593070..1c43ae7 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -275,7 +275,10 @@ static int get_data_center(char *accept_tag, char *effective_tag_key, char *data if(item!=NULL) { cJSON *tag_item=cJSON_GetObjectItem(item, "tag"); - if(tag_item!=NULL && tag_item->valuestring!=NULL && (memcmp(effective_tag_key, tag_item->valuestring, strlen(effective_tag_key)))==0) + if(tag_item!=NULL && + tag_item->valuestring!=NULL && + strlen(effective_tag_key)==strlen(tag_item->valuestring) && + (memcmp(effective_tag_key, tag_item->valuestring, strlen(effective_tag_key)))==0) { cJSON *v_item=cJSON_GetObjectItem(item, "value"); if(v_item!=NULL && v_item->valuestring!=NULL) |
