From 93a27747a485624d4a89550036e12eeec96d4558 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Tue, 29 Nov 2005 15:04:06 +0000 Subject: [PATCH] src/fcint.h (FcCacheBankToIndex); Fix segfault by guarding array dereference. --- ChangeLog | 5 +++++ src/fcint.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 * -- 2.39.5