[PATCH] gdi32: remove a incorrect sizeof from pointer arithmetic (Coverity)
Marcus Meissner
meissner at suse.de
Mon Oct 17 22:07:32 CDT 2011
Hi,
The addition is happening in pointer context already, so sizeof(*ptr)
is actually gotten by adding 1.
Ciao, Marcus
---
dlls/gdi32/tests/font.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index f127743..a17b4c8 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -2473,7 +2473,7 @@ static BOOL get_first_last_from_cmap4(void *ptr, DWORD *first, DWORD *last, DWOR
+ i - seg_count;
/* some fonts have broken last segment */
- if ((char *)(glyph_ids + index + sizeof(*glyph_ids)) < (char *)ptr + limit)
+ if ((char *)(glyph_ids + index + 1) < (char *)ptr + limit)
index = GET_BE_WORD(glyph_ids[index]);
else
{
--
1.7.1
More information about the wine-patches
mailing list