[array] Use hb_memcmp instead of memcmp

Fixes ubsan error.
This commit is contained in:
Behdad Esfahbod 2022-05-20 12:34:49 -06:00
parent 55804e8d68
commit 975a5f9194
1 changed files with 2 additions and 2 deletions

View File

@ -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 <>