Module: wine Branch: master Commit: 605a40e477386264efc57a097f1df6e9cfb06ca4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=605a40e477386264efc57a097f... Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Thu Jan 29 09:46:21 2009 +0100 riched20: Handle NULL fp more gracefully (Coverity). --- dlls/riched20/reader.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c index f99ac58..c5a3a35 100644 --- a/dlls/riched20/reader.c +++ b/dlls/riched20/reader.c @@ -871,8 +871,10 @@ static void ReadFontTbl(RTF_Info *info) break; } fp = New (RTFFont); - if (fp == NULL) + if (fp == NULL) { ERR ( "%s: cannot allocate font entry\n", fn); + break; + } fp->rtfNextFont = info->fontList; info->fontList = fp; @@ -992,7 +994,7 @@ static void ReadFontTbl(RTF_Info *info) TRACE("default font codepage %d\n", info->codePage); } } - if (fp->rtfFNum == -1) + if (!fp || (fp->rtfFNum == -1)) ERR( "%s: missing font number\n", fn); /* * Could check other pieces of structure here, too, I suppose.