--- a/libclamav/yara_exec.c 2022-05-01 23:24:50.000000000 -0700 +++ b/libclamav/yara_exec.c 2022-06-21 15:21:13.652598961 -0700 @@ -426,7 +426,7 @@ break; case OP_PUSH_RULE: - rule = *(YR_RULE**)(ip + 1); + memcpy(&rule, ip + 1, sizeof(YR_RULE *)); ip += sizeof(uint64_t); #if REAL_YARA push(rule->t_flags[tidx] & RULE_TFLAGS_MATCH ? 1 : 0); @@ -437,7 +437,7 @@ case OP_MATCH_RULE: pop(r1); - rule = *(YR_RULE**)(ip + 1); + memcpy(&rule, ip + 1, sizeof(YR_RULE *)); ip += sizeof(uint64_t); if (!IS_UNDEFINED(r1) && r1) @@ -457,7 +457,7 @@ break; case OP_OBJ_LOAD: - identifier = *(char**)(ip + 1); + memcpy(&identifier, ip + 1, sizeof(char *)); ip += sizeof(uint64_t); object = (YR_OBJECT*) yr_hash_table_lookup( @@ -473,7 +473,7 @@ case OP_OBJ_FIELD: pop(r1); - identifier = *(char**)(ip + 1); + memcpy(&identifier, ip + 1, sizeof(char *)); ip += sizeof(uint64_t); if (IS_UNDEFINED(r1)) ---