[PATCH] riched20: Handle NULL fp more gracefully (Coverity)
Marcus Meissner
marcus at jet.franken.de
Thu Jan 29 02:46:21 CST 2009
Hi,
CID 193, 192 ... handle fp NULL more gracefully.
ERR() is still printed to point out that it might need
better error recovery.
Ciao, Marcus
---
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 295d6d8..b5fdb78 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.
--
1.5.6
More information about the wine-patches
mailing list