Fix segfault by guarding array dereference.
+2005-11-29 Patrick Lam <plam@mit.edu>
+ * src/fcint.h (FcCacheBankToIndex);
+
+ Fix segfault by guarding array dereference.
+
2005-11-29 Dirk Mueller <dmueller@suse.de>
reviewed by: plam
static __inline__ int
FcCacheBankToIndex (int bank)
{
- return _fcBankId[*_fcBankIdx] == bank ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
+ return (_fcBankId && _fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
}
const char *