Fix QNetworkConfigurationManager crash due to null private pointer. (QTBUG-17305, rhbz#682656)

This commit is contained in:
Jaroslav Reznik 2011-03-07 15:20:39 +01:00
parent d72d8fa998
commit 6e9f536460
2 changed files with 64 additions and 1 deletions

View File

@ -0,0 +1,57 @@
From 4d3b9aa83cf7f6d9f9b88d9936e5980629daac2a Mon Sep 17 00:00:00 2001
From: Cristiano di Flora <cristiano.di-flora@nokia.com>
Date: Tue, 22 Feb 2011 05:27:51 +0200
Subject: [PATCH] Fix QNetworkConfigurationManager crash due to null private pointer.
Reviewed-by: Aaron McCarthy
Task-Number: QTBUG-17305
(cherry picked from commit 7388fcb83592a90aace054314e0c3e7e7a94fdae)
---
src/network/bearer/qnetworkconfigmanager.cpp | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp
index 0e3c519..7eadb82 100644
--- a/src/network/bearer/qnetworkconfigmanager.cpp
+++ b/src/network/bearer/qnetworkconfigmanager.cpp
@@ -57,16 +57,17 @@ QT_BEGIN_NAMESPACE
{ \
delete this_##NAME.pointer; \
this_##NAME.pointer = 0; \
- this_##NAME.destroyed = true; \
} \
static TYPE *NAME() \
{ \
- if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
+ if (!this_##NAME.pointer) { \
TYPE *x = new TYPE; \
if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
delete x; \
- else \
+ else { \
qAddPostRoutine(NAME##_cleanup); \
+ this_##NAME.pointer->updateConfigurations(); \
+ } \
} \
return this_##NAME.pointer; \
}
@@ -75,15 +76,7 @@ Q_GLOBAL_STATIC_QAPP_DESTRUCTION(QNetworkConfigurationManagerPrivate, connManage
QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
{
- static bool initialized = false;
-
- QNetworkConfigurationManagerPrivate *m = connManager();
- if (!initialized) {
- initialized = true;
- m->updateConfigurations();
- }
-
- return m;
+ return connManager();
}
/*!
--
1.6.1

View File

@ -18,7 +18,7 @@ Summary: Qt toolkit
Name: qt Name: qt
Epoch: 1 Epoch: 1
Version: 4.7.2 Version: 4.7.2
Release: 1%{?dist} Release: 2%{?dist}
# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details # See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT
@ -95,6 +95,8 @@ Patch65: qt-everywhere-opensource-src-4.7.1-qtreeview-kpackagekit-crash.patch
# adds debug support to webkit/JavaScriptCore # adds debug support to webkit/JavaScriptCore
# UPSTREAM ME # UPSTREAM ME
Patch105: qt-everywhere-opensource-src-4.7.1-webkit_debug_javascriptcore.patch Patch105: qt-everywhere-opensource-src-4.7.1-webkit_debug_javascriptcore.patch
# Fix QNetworkConfigurationManager crash due to null private pointer. (QTBUG-17305, rhbz#682656)
Patch106: http://qt.gitorious.org/qt/qt/commit/4d3b9aa83cf7f6d9f9b88d9936e5980629daac2a.patch
# kde-qt git patches # kde-qt git patches
Patch202: 0002-This-patch-makes-override-redirect-windows-popup-men.patch Patch202: 0002-This-patch-makes-override-redirect-windows-popup-men.patch
@ -493,6 +495,7 @@ Qt libraries used for drawing widgets and OpenGL items.
# upstream patches # upstream patches
%patch105 -p1 -b .webkit_debug_javascriptcore %patch105 -p1 -b .webkit_debug_javascriptcore
%patch106 -p1 -b .QNetworkConfigurationManager-null-pointer
# kde-qt branch # kde-qt branch
%if 0%{?kde_qt} %if 0%{?kde_qt}
@ -1186,6 +1189,9 @@ fi
%changelog %changelog
* Mon Mar 07 2011 Jaroslav Reznik <jreznik@redhat.com> 1:4.7.2-2
- Fix QNetworkConfigurationManager crash due to null private pointer (#682656)
* Tue Mar 01 2011 Jaroslav Reznik <jreznik@redhat.com> 1:4.7.2-1 * Tue Mar 01 2011 Jaroslav Reznik <jreznik@redhat.com> 1:4.7.2-1
- 4.7.2 - 4.7.2