From 19532eec2ae1a723e981e3f90730905cabedb9c8 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 10 Mar 2014 14:44:22 +0100 Subject: Fix casting and overallocation in qregion.cpp The POINTBLOCK struct in qregion.cpp is badly defined. By using ints as the base storage of the internal array it forces not only bad casting from int to QPoint, but also allocates an array four times too big. This patch changes to char, since a char pointer may alias anything and this gives the right size of the array. Change-Id: I608eaf39ac7306c71314a139bed6e2352249c0ab Reviewed-by: Gunnar Sletta --- src/gui/painting/qregion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting/qregion.cpp') diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index beeac6bd43..20c62fdd9d 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -1713,7 +1713,7 @@ QT_END_INCLUDE_NAMESPACE * the buffers together */ typedef struct _POINTBLOCK { - int data[NUMPTSTOBUFFER * sizeof(QPoint)]; + char data[NUMPTSTOBUFFER * sizeof(QPoint)]; QPoint *pts; struct _POINTBLOCK *next; } POINTBLOCK; -- cgit v1.2.3