@@ -540,7 +540,7 @@ int yr_execute_code(
540
540
break ;
541
541
542
542
case OP_PUSH :
543
- r1 .i = * (uint64_t * )( ip );
543
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
544
544
ip += sizeof (uint64_t );
545
545
push (r1 );
546
546
break ;
@@ -550,7 +550,7 @@ int yr_execute_code(
550
550
break ;
551
551
552
552
case OP_CLEAR_M :
553
- r1 .i = * (uint64_t * )( ip );
553
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
554
554
ip += sizeof (uint64_t );
555
555
#if YR_PARANOID_EXEC
556
556
ensure_within_mem (r1 .i );
@@ -559,7 +559,7 @@ int yr_execute_code(
559
559
break ;
560
560
561
561
case OP_ADD_M :
562
- r1 .i = * (uint64_t * )( ip );
562
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
563
563
ip += sizeof (uint64_t );
564
564
#if YR_PARANOID_EXEC
565
565
ensure_within_mem (r1 .i );
@@ -570,7 +570,7 @@ int yr_execute_code(
570
570
break ;
571
571
572
572
case OP_INCR_M :
573
- r1 .i = * (uint64_t * )( ip );
573
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
574
574
ip += sizeof (uint64_t );
575
575
#if YR_PARANOID_EXEC
576
576
ensure_within_mem (r1 .i );
@@ -579,7 +579,7 @@ int yr_execute_code(
579
579
break ;
580
580
581
581
case OP_PUSH_M :
582
- r1 .i = * (uint64_t * )( ip );
582
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
583
583
ip += sizeof (uint64_t );
584
584
#if YR_PARANOID_EXEC
585
585
ensure_within_mem (r1 .i );
@@ -589,7 +589,7 @@ int yr_execute_code(
589
589
break ;
590
590
591
591
case OP_POP_M :
592
- r1 .i = * (uint64_t * )( ip );
592
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
593
593
ip += sizeof (uint64_t );
594
594
#if YR_PARANOID_EXEC
595
595
ensure_within_mem (r1 .i );
@@ -599,7 +599,7 @@ int yr_execute_code(
599
599
break ;
600
600
601
601
case OP_SET_M :
602
- r1 .i = * (uint64_t * )( ip );
602
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
603
603
ip += sizeof (uint64_t );
604
604
#if YR_PARANOID_EXEC
605
605
ensure_within_mem (r1 .i );
@@ -611,7 +611,7 @@ int yr_execute_code(
611
611
break ;
612
612
613
613
case OP_SWAPUNDEF :
614
- r1 .i = * (uint64_t * )( ip );
614
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
615
615
ip += sizeof (uint64_t );
616
616
#if YR_PARANOID_EXEC
617
617
ensure_within_mem (r1 .i );
@@ -802,7 +802,7 @@ int yr_execute_code(
802
802
break ;
803
803
804
804
case OP_PUSH_RULE :
805
- r1 .i = * (uint64_t * )( ip );
805
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
806
806
ip += sizeof (uint64_t );
807
807
808
808
rule = & context -> rules -> rules_list_head [r1 .i ];
@@ -841,7 +841,7 @@ int yr_execute_code(
841
841
case OP_MATCH_RULE :
842
842
pop (r1 );
843
843
844
- r2 .i = * (uint64_t * )( ip );
844
+ memcpy ( & r2 .i , ip , sizeof (uint64_t ) );
845
845
ip += sizeof (uint64_t );
846
846
847
847
rule = & context -> rules -> rules_list_head [r2 .i ];
@@ -1316,7 +1316,7 @@ int yr_execute_code(
1316
1316
break ;
1317
1317
1318
1318
case OP_IMPORT :
1319
- r1 .i = * (uint64_t * )( ip );
1319
+ memcpy ( & r1 .i , ip , sizeof (uint64_t ) );
1320
1320
ip += sizeof (uint64_t );
1321
1321
1322
1322
result = yr_modules_load ((char * ) r1 .p , context );
@@ -1356,8 +1356,7 @@ int yr_execute_code(
1356
1356
break ;
1357
1357
1358
1358
case OP_INT_TO_DBL :
1359
-
1360
- r1 .i = * (uint64_t * )(ip );
1359
+ memcpy (& r1 .i , ip , sizeof (uint64_t ));
1361
1360
ip += sizeof (uint64_t );
1362
1361
1363
1362
#if YR_PARANOID_EXEC
0 commit comments