diff --git a/ChangeLog b/ChangeLog index d49ecc4..849d55e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-29 Patrick Lam + * src/fcint.h (FcCacheBankToIndex); + + Fix segfault by guarding array dereference. + 2005-11-29 Dirk Mueller reviewed by: plam diff --git a/src/fcint.h b/src/fcint.h index c61a232..5c2425b 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -469,7 +469,7 @@ FcCacheBankToIndexMTF (int bank); static __inline__ int FcCacheBankToIndex (int bank) { - return _fcBankId[*_fcBankIdx] == bank ? *_fcBankIdx : FcCacheBankToIndexMTF(bank); + return (_fcBankId && _fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank); } const char *