Marcus Meissner : riched20: Swap check for NULL ptr and first usage ( Coverity).
Alexandre Julliard
julliard at winehq.org
Wed Oct 19 20:47:57 CDT 2016
Module: wine
Branch: master
Commit: c1a8fbbb77121165b34fb84d8578d2232dab4575
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c1a8fbbb77121165b34fb84d8578d2232dab4575
Author: Marcus Meissner <marcus at jet.franken.de>
Date: Wed Oct 19 09:26:00 2016 +0200
riched20: Swap check for NULL ptr and first usage (Coverity).
Signed-off-by: Marcus Meissner <marcus at jet.franken.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/riched20/para.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c
index 3f54fea..6c023f2 100644
--- a/dlls/riched20/para.c
+++ b/dlls/riched20/para.c
@@ -156,7 +156,7 @@ static ME_String *para_num_get_str( ME_Paragraph *para, WORD num )
{
/* max 4 Roman letters (representing '8') / decade + '(' + ')' */
ME_String *str = ME_MakeStringEmpty( 20 + 2 );
- WCHAR *p = str->szData;
+ WCHAR *p;
static const WCHAR fmtW[] = {'%', 'd', 0};
static const WORD letter_base[] = { 1, 26, 26 * 26, 26 * 26 * 26 };
/* roman_base should start on a '5' not a '1', otherwise the 'total' code will need adjusting.
@@ -177,6 +177,8 @@ static ME_String *para_num_get_str( ME_Paragraph *para, WORD num )
if (!str) return NULL;
+ p = str->szData;
+
if ((para->fmt.wNumberingStyle & 0xf00) == PFNS_PARENS)
*p++ = '(';
More information about the wine-cvs
mailing list