[array] Use hb_memcmp instead of memcmp

Fixes ubsan error.
pull/3608/head
Behdad Esfahbod 3 years ago
parent 55804e8d68
commit 975a5f9194
  1. 4
      src/hb-array.hh

@ -416,13 +416,13 @@ template <>
inline bool hb_array_t<const char>::operator == (const hb_array_t<const char> &o) const
{
if (o.length != this->length) return false;
return 0 == memcmp (arrayZ, o.arrayZ, length);
return 0 == hb_memcmp (arrayZ, o.arrayZ, length);
}
template <>
inline bool hb_array_t<const unsigned char>::operator == (const hb_array_t<const unsigned char> &o) const
{
if (o.length != this->length) return false;
return 0 == memcmp (arrayZ, o.arrayZ, length);
return 0 == hb_memcmp (arrayZ, o.arrayZ, length);
}
template <>

Loading…
Cancel
Save