Commit 665584a1 authored by Akira TAGOH's avatar Akira TAGOH
Browse files

Validate cache more carefully

Reject caches when FcPattern isn't a constant.
This is usually unlikely to happen but reported.
I've decided to add more validation since this isn't reproducible
and easy to have a workaround rather than investigating 'why'.

https://bugs.freedesktop.org/show_bug.cgi?id=103237
parent bc0240bf
...@@ -646,7 +646,8 @@ FcCacheOffsetsValid (FcCache *cache) ...@@ -646,7 +646,8 @@ FcCacheOffsetsValid (FcCache *cache)
(char *) font > end - sizeof (FcFontSet) || (char *) font > end - sizeof (FcFontSet) ||
font->elts_offset < 0 || font->elts_offset < 0 ||
font->elts_offset > end - (char *) font || font->elts_offset > end - (char *) font ||
font->num > (end - (char *) font - font->elts_offset) / sizeof (FcPatternElt)) font->num > (end - (char *) font - font->elts_offset) / sizeof (FcPatternElt) ||
!FcRefIsConst (&font->ref))
return FcFalse; return FcFalse;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment