diff options
| author | root <[email protected]> | 2024-10-29 07:51:04 +0000 |
|---|---|---|
| committer | root <[email protected]> | 2024-10-29 07:51:04 +0000 |
| commit | bc529949228892e0ca17487a903134726932d67c (patch) | |
| tree | 6d496d0ce179055b1a6953489a66161ad05017d9 | |
| parent | 9d72c83e9fd499f5246b6fc35bffd182e0bd9ebb (diff) | |
fix coredump when rule is invalidv5.0.2
| -rw-r--r-- | src/maat_expr.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/maat_expr.c b/src/maat_expr.c index 03c8788..1b06e42 100644 --- a/src/maat_expr.c +++ b/src/maat_expr.c @@ -96,7 +96,7 @@ expr_item_new(struct expr_schema *expr_schema, const char *table_name, uuid_copy(expr_item->item_uuid, item_uuid); tmp_obj = cJSON_GetObjectItem(json, "object_uuid"); - if (tmp_obj == NULL && tmp_obj->type != cJSON_String) { + if (tmp_obj == NULL || tmp_obj->type != cJSON_String) { char *json_str = cJSON_Print(json); log_fatal(expr_rt->logger, MODULE_EXPR, "[%s:%d] expr table:<%s> has no object_id in line:%s", @@ -471,7 +471,6 @@ static int expr_keywords_to_expr_pattern(char *keywords, struct expr_pattern *pa region_str_len = hex2bin(hex_str_start, strlen(hex_str_start), region_string, region_str_len); tmp_start_str = str_unescape(tmp_start_str); - //snprintf(tmp_keywords + pattern_len, MAX_KEYWORDS_STR_LEN - pattern_len, "%s%s", tmp_start_str, region_string); if (pattern_len + strlen(tmp_start_str) + region_str_len > MAX_KEYWORDS_STR_LEN) { return -1; } |
