From dc228048a813e43356373505168d3822deea5d72 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 Apr 2010 13:22:41 -0400 Subject: [PATCH] Remove integrity check in Tag sanitize Serves no useful purpose. --- src/hb-open-type-private.hh | 9 --------- src/hb-ot-layout-common-private.hh | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index d1bcf8ea..fde4d7fe 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -406,15 +406,6 @@ struct Tag : ULONG /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ inline operator const char* (void) const { return CharP(this); } inline operator char* (void) { return CharP(this); } - - inline bool sanitize (SANITIZE_ARG_DEF) { - TRACE_SANITIZE (); - /* Note: Only accept ASCII-visible tags (mind DEL) - * This is one of the few places (only place?) that we check - * for data integrity, as opposed to just boundary checks. - */ - return SANITIZE_SELF () && (((uint32_t) *this) & 0x80808080) == 0; - } }; ASSERT_SIZE (Tag, 4); DEFINE_NULL_DATA (Tag, 4, " "); diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 38d19835..4973a135 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -55,7 +55,7 @@ struct Record inline bool sanitize (SANITIZE_ARG_DEF, void *base) { TRACE_SANITIZE (); - return SANITIZE (tag) && SANITIZE_BASE (offset, base); + return SANITIZE_SELF () && SANITIZE_BASE (offset, base); } Tag tag; /* 4-byte Tag identifier */ -- 2.34.1