diff options
author | Patrick Lam <plam@MIT.EDU> | 2006-02-06 14:44:46 +0000 |
---|---|---|
committer | Patrick Lam <plam@MIT.EDU> | 2006-02-06 14:44:46 +0000 |
commit | 86e75dfb5d1434837537b40e829f00f9ffbb8183 (patch) | |
tree | 60af5f46cf1db8d4c5565aacf08d0ecc697ec156 | |
parent | f076169d19574c6c548764d574a33bc4fe022ffb (diff) |
Explain apples/oranges comparison and fix compilation error.
reviewed by: plam
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/fcfs.c | 5 |
2 files changed, 11 insertions, 1 deletions
@@ -3,6 +3,13 @@ * src/fcfs.c (FcFontSetUnserialize): + Explain apples/oranges comparison and fix compilation error. + +2006-02-06 Dirk Mueller <dmueller@suse.de> + reviewed by: plam + + * src/fcfs.c (FcFontSetUnserialize): + Insert check for integer overflow in # of fonts. 2006-02-04 Behdad Esfahbod <behdad@cs.toronto.edu> @@ -159,7 +159,10 @@ FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr) nfont = *(int *)block_ptr; block_ptr = (int *)block_ptr + 1; - if (nfont > 0 && nfont < metadata.count) + /* comparing nfont and metadata.count is a bit like comparing + apples and oranges. Its just for rejecting totally insane + nfont values, and for that its good enough */ + if (nfont > 0 && nfont < metadata->count / sizeof(void*)) { FcPattern * p = (FcPattern *)block_ptr; |