Alexandre Julliard : gdiplus: Fix a string buffer overflow.

Alexandre Julliard julliard at winehq.org
Thu Sep 25 07:13:30 CDT 2008


Module: wine
Branch: master
Commit: a2d04673e6522036fe7f3d9ee3b7a10b6ae41435
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a2d04673e6522036fe7f3d9ee3b7a10b6ae41435

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Sep 25 11:19:23 2008 +0200

gdiplus: Fix a string buffer overflow.

---

 dlls/gdiplus/graphics.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index c1e63f6..3689fd3 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -2625,7 +2625,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
 
     if(length == -1) length = lstrlenW(string);
 
-    stringdup = GdipAlloc(length * sizeof(WCHAR));
+    stringdup = GdipAlloc((length + 1) * sizeof(WCHAR));
     if(!stringdup) return OutOfMemory;
 
     oldfont = SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw));




More information about the wine-cvs mailing list