From e42d7f95910d5d5322919baf29be8cacfd46a5bb Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Fri, 5 Jun 2009 09:20:27 +0200 Subject: [PATCH] msctf: Fix a possible NULL dereference (Coverity). --- dlls/msctf/range.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/msctf/range.c b/dlls/msctf/range.c index 8b1f4822777..dc9eae15c60 100644 --- a/dlls/msctf/range.c +++ b/dlls/msctf/range.c @@ -349,11 +349,13 @@ HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD l HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp) { - Range *This = (Range *)tf->range; + Range *This; if (!tf || !tsAcp || !tf->range) return E_INVALIDARG; + This = (Range *)tf->range; + tsAcp->acpStart = This->anchorStart; tsAcp->acpEnd = This->anchorEnd; tsAcp->style.ase = tf->style.ase;