rpms/qt/F-11 0ebc9783d8ca0c4b27208bbc002c53c52c19ab4c.patch, NONE, 1.1 55ef01d93f8257b5927660290fc1ead0b2b74ec9.patch, NONE, 1.1 qt.spec, 1.298, 1.299

Than Ngo than at fedoraproject.org
Tue Jun 8 16:51:49 UTC 2010


Author: than

Update of /cvs/extras/rpms/qt/F-11
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv14799

Modified Files:
	qt.spec 
Added Files:
	0ebc9783d8ca0c4b27208bbc002c53c52c19ab4c.patch 
	55ef01d93f8257b5927660290fc1ead0b2b74ec9.patch 
Log Message:
- Unsafe use of rand() in X11 (QTBUG-9793)
- support QT_GRAPHICSSYSTEM env



0ebc9783d8ca0c4b27208bbc002c53c52c19ab4c.patch:
 kernel/qwidget_x11.cpp        |    2 +-
 painting/qpaintengine_x11.cpp |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

--- NEW FILE 0ebc9783d8ca0c4b27208bbc002c53c52c19ab4c.patch ---
>From 0ebc9783d8ca0c4b27208bbc002c53c52c19ab4c Mon Sep 17 00:00:00 2001
From: Bradley T. Hughes <bradley.hughes at nokia.com>
Date: Tue, 4 May 2010 16:25:18 +0200
Subject: [PATCH] Use qrand() instead of rand()

This only affects X11 code, and are the only 2 places in Qt where rand() is
used instead of qrand().

Task-number: QTBUG-9793
Reviewed-by: TrustMe
---
 src/gui/kernel/qwidget_x11.cpp        |    2 +-
 src/gui/painting/qpaintengine_x11.cpp |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 37ac6bf..43f510c 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -3000,7 +3000,7 @@ Picture QX11Data::getSolidFill(int screen, const QColor &c)
             return X11->solid_fills[i].picture;
     }
     // none found, replace one
-    int i = rand() % 16;
+    int i = qrand() % 16;
 
     if (X11->solid_fills[i].screen != screen && X11->solid_fills[i].picture) {
         XRenderFreePicture (X11->display, X11->solid_fills[i].picture);
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index da48fcb..aef8b80 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -315,7 +315,7 @@ static Picture getPatternFill(int screen, const QBrush &b)
             return X11->pattern_fills[i].picture;
     }
     // none found, replace one
-    int i = rand() % 16;
+    int i = qrand() % 16;
 
     if (X11->pattern_fills[i].screen != screen && X11->pattern_fills[i].picture) {
 	XRenderFreePicture (X11->display, X11->pattern_fills[i].picture);
-- 
1.6.1


55ef01d93f8257b5927660290fc1ead0b2b74ec9.patch:
 qapplication.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- NEW FILE 55ef01d93f8257b5927660290fc1ead0b2b74ec9.patch ---
>From 55ef01d93f8257b5927660290fc1ead0b2b74ec9 Mon Sep 17 00:00:00 2001
From: Andreas Hartmetz <ahartmetz at gmail.com>
Date: Thu, 18 Mar 2010 02:41:14 +0100
Subject: [PATCH] Add environment variable switch for graphicssystem so distros and
 non-developers can more easily pick a different default.

---
 src/gui/kernel/qapplication.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 49713cf..af83047 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -763,6 +763,10 @@ void QApplicationPrivate::construct(
 
     qt_is_gui_used = (qt_appType != QApplication::Tty);
     process_cmdline();
+    // the environment variable has the lowest precedence of runtime graphicssystem switches
+    if (graphics_system_name.isEmpty()) {
+        graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM"));
+    }
     // Must be called before initialize()
     qt_init(this, qt_appType
 #ifdef Q_WS_X11
-- 
1.6.1



Index: qt.spec
===================================================================
RCS file: /cvs/extras/rpms/qt/F-11/qt.spec,v
retrieving revision 1.298
retrieving revision 1.299
diff -u -p -r1.298 -r1.299
--- qt.spec	7 May 2010 03:59:08 -0000	1.298
+++ qt.spec	8 Jun 2010 16:51:49 -0000	1.299
@@ -13,7 +13,7 @@ Summary: Qt toolkit
 Name:    qt
 Epoch:   1
 Version: 4.6.2
-Release: 18%{?dist}
+Release: 20%{?dist}
 
 # See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
 License: LGPLv2 with exceptions or GPLv3 with exceptions
@@ -91,6 +91,9 @@ Patch213: qt-x11-opensource-src-4.6.2-ta
 Patch214: qt-everywhere-opensource-src-4.6.2-QTBUG-6932.patch
 patch215: qt-everywhere-opensource-src-4.6.2-atomic-s390.patch
 patch216: qt-everywhere-opensource-src-4.6.2-cups-QTBUG-6471.patch
+Patch217: http://qt.gitorious.org/+kde-developers/qt/kde-qt/commit/55ef01d93f8257b5927660290fc1ead0b2b74ec9.patch
+# QTBUG-9793
+Patch218: http://qt.gitorious.org/qt/qt/commit/0ebc9783d8ca0c4b27208bbc002c53c52c19ab4c.patch
 
 Source10: http://gstreamer.freedesktop.org/data/images/artwork/gstreamer-logo.svg
 Source11: hi16-phonon-gstreamer.png
@@ -457,6 +460,8 @@ Qt libraries used for drawing widgets an
 %patch214 -p1 -b .QTBUG-6932
 %patch215 -p1 -b .atomic-s390
 %patch216 -p1 -b .cups-QTBUG-6471
+%patch217 -p1 -b .QT_GRAPHICSSYSTEM
+%patch218 -p1 -b .QTBUG-9793
 
 # drop -fexceptions from $RPM_OPT_FLAGS
 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'`
@@ -1052,6 +1057,12 @@ fi
 
 
 %changelog
+* Thu May 27 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.6.2-20 
+- Unsafe use of rand() in X11 (QTBUG-9793)
+
+* Mon May 17 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.6.2-19
+- support QT_GRAPHICSSYSTEM env
+
 * Thu May 06 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.6.2-18
 - +Provides: qt4-webkit(-devel)
 



More information about the scm-commits mailing list