diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index cf6080a9b33..6f4a8a5ce4d 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -889,6 +889,8 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, WCHAR *text, CH if (nCurEnd - nMatched == 0) { pCurItem = ME_FindItemBack(pCurItem, diRun); + /* Don't care about pCurItem becoming NULL here; it's already taken + * care of in the exterior loop condition */ para = ME_GetParagraph(pCurItem); nCurEnd = ME_StrLen(pCurItem->member.run.strText) + nMatched; }