From: Patrick Lam Date: Tue, 29 Nov 2005 15:04:06 +0000 (+0000) Subject: src/fcint.h (FcCacheBankToIndex); X-Git-Tag: fc-2_3_93~13 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=93a27747a485624d4a89550036e12eeec96d4558;p=fontconfig.git src/fcint.h (FcCacheBankToIndex); Fix segfault by guarding array dereference. --- 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 *