From f8eea2e93741c20d63475b01cdafc694faa58947 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Wed, 31 Dec 2003 14:43:48 +0000 Subject: [PATCH] fixed infinite loop if the number of clipping rectangles exceeded the maximum allowed. svn path=/trunk/; revision=7369 --- reactos/subsys/win32k/eng/clip.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reactos/subsys/win32k/eng/clip.c b/reactos/subsys/win32k/eng/clip.c index f179035a9c0..7e5e879b15b 100644 --- a/reactos/subsys/win32k/eng/clip.c +++ b/reactos/subsys/win32k/eng/clip.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: clip.c,v 1.17 2003/10/30 08:56:37 gvg Exp $ +/* $Id: clip.c,v 1.18 2003/12/31 14:43:48 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -328,7 +328,10 @@ CLIPOBJ_bEnum(IN CLIPOBJ* ClipObj, nCopy = min( ClipGDI->EnumMax - ClipGDI->EnumPos, min( ClipGDI->EnumRects.c - ClipGDI->EnumPos, (ObjSize - sizeof(ULONG)) / sizeof(RECTL))); - + if(nCopy == 0) + { + return FALSE; + } RtlCopyMemory( pERects->arcl, ClipGDI->EnumRects.arcl + ClipGDI->EnumPos, nCopy * sizeof(RECTL) ); pERects->c = nCopy;