Kaynağa Gözat

Fix sanitizer pointer overflow warning when perform pointer arithmetic (#2098)

Convert the pointer to intptr_t to perform arithmetic to avoid the warning.
Wenyong Huang 2 yıl önce
ebeveyn
işleme
5c201995f1
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      core/shared/mem-alloc/ems/ems_kfc.c

+ 1 - 1
core/shared/mem-alloc/ems/ems_kfc.c

@@ -153,7 +153,7 @@ static void
 adjust_ptr(uint8 **p_ptr, intptr_t offset)
 {
     if (*p_ptr)
-        *p_ptr += offset;
+        *p_ptr = (uint8 *)((intptr_t)(*p_ptr) + offset);
 }
 
 int