summaryrefslogtreecommitdiff
blob: d647874f6c4dee728d9794ee2e223c560636f499 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
qt-bugs@ issue : none
bugs.kde.org number : none
applied: no
author: Dirk Mueller/TT

Fixes various, partially exploitable format string errors on Qt 3.x code base.


--- src/widgets/qtextedit.cpp	Mon Jul 16 10:44:40 CEST 2007
+++ src/widgets/qtextedit.cpp	Mon Jul 16 10:44:40 CEST 2007

@@ -6349,7 +6349,7 @@
 		    cur = tag->prev;
 		    if ( !cur ) {
 #ifdef QT_CHECK_RANGE
-			qWarning( "QTextEdit::optimParseTags: no left-tag for '<" + tag->tag + ">' in line %d.", tag->line + 1 );
+			qWarning( "QTextEdit::optimParseTags: no left-tag for '<%s>' in line %d.", tag->tag.ascii(), tag->line + 1 );
 #endif
 			return; // something is wrong - give up
 		    }
@@ -6372,7 +6372,7 @@
 				    break;
 				} else if ( !cur->leftTag ) {
 #ifdef QT_CHECK_RANGE
-				    qWarning( "QTextEdit::optimParseTags: mismatching %s-tag for '<" + cur->tag + ">' in line %d.", cur->tag[0] == '/' ? "left" : "right", cur->line + 1 );
+				    qWarning( "QTextEdit::optimParseTags: mismatching %s-tag for '<%s>' in line %d.", cur->tag[0] == '/' ? "left" : "right", cur->tag.ascii(), cur->line + 1 );
 #endif
 				    return; // something is amiss - give up
 				}
--- src/sql/qdatatable.cpp	Mon Jul 16 10:45:03 CEST 2007
+++ src/sql/qdatatable.cpp	Mon Jul 16 10:45:03 CEST 2007

@@ -1043,8 +1043,8 @@
 	return FALSE;
     if ( !sqlCursor()->canInsert() ) {
 #ifdef QT_CHECK_RANGE
-	qWarning("QDataTable::insertCurrent: insert not allowed for " +
-		 sqlCursor()->name() );
+	qWarning("QDataTable::insertCurrent: insert not allowed for %s",
+		 sqlCursor()->name().latin1() );
 #endif
 	endInsert();
 	return FALSE;
@@ -1117,16 +1117,16 @@
 	return FALSE;
     if ( sqlCursor()->primaryIndex().count() == 0 ) {
 #ifdef QT_CHECK_RANGE
-	qWarning("QDataTable::updateCurrent: no primary index for " +
-		 sqlCursor()->name() );
+	qWarning("QDataTable::updateCurrent: no primary index for %s",
+		 sqlCursor()->name().latin1() );
 #endif
 	endUpdate();
 	return FALSE;
     }
     if ( !sqlCursor()->canUpdate() ) {
 #ifdef QT_CHECK_RANGE
-	qWarning("QDataTable::updateCurrent: updates not allowed for " +
-		 sqlCursor()->name() );
+	qWarning("QDataTable::updateCurrent: updates not allowed for %s",
+		 sqlCursor()->name().latin1() );
 #endif
 	endUpdate();
 	return FALSE;
@@ -1191,8 +1191,8 @@
 	return FALSE;
     if ( sqlCursor()->primaryIndex().count() == 0 ) {
 #ifdef QT_CHECK_RANGE
-	qWarning("QDataTable::deleteCurrent: no primary index " +
-		 sqlCursor()->name() );
+	qWarning("QDataTable::deleteCurrent: no primary index %s",
+		 sqlCursor()->name().latin1() );
 #endif
 	return FALSE;
     }

--- src/sql/qsqldatabase.cpp	Mon Jul 16 10:45:03 CEST 2007
+++ src/sql/qsqldatabase.cpp	Mon Jul 16 10:45:03 CEST 2007

@@ -234,7 +234,8 @@
 	db->open();
 #ifdef QT_CHECK_RANGE
 	if ( !db->isOpen() )
-	    qWarning("QSqlDatabaseManager::database: unable to open database: " + db->lastError().databaseText() + ": " + db->lastError().driverText() );
+	    qWarning("QSqlDatabaseManager::database: unable to open database: %s: %s",
+                    db->lastError().databaseText().latin1(), db->lastError().driverText().latin1() );
 #endif
     }
     return db;
@@ -686,7 +687,7 @@
     if ( !d->driver ) {
 #ifdef QT_CHECK_RANGE
 	qWarning( "QSqlDatabase: %s driver not loaded", type.latin1() );
-	qWarning( "QSqlDatabase: available drivers: " + drivers().join(" ") );
+	qWarning( "QSqlDatabase: available drivers: %s", drivers().join(" ").latin1() );
 #endif
 	d->driver = new QNullDriver();
 	d->driver->setLastError( QSqlError( "Driver not loaded", "Driver not loaded" ) );

--- src/sql/qsqlindex.cpp	Mon Jul 16 10:45:03 CEST 2007
+++ src/sql/qsqlindex.cpp	Mon Jul 16 10:45:03 CEST 2007

@@ -273,7 +273,7 @@
 	if ( field )
 	    newSort.append( *field, desc );
 	else
-	    qWarning( "QSqlIndex::fromStringList: unknown field: '" + f + "'" );
+	    qWarning( "QSqlIndex::fromStringList: unknown field: '%s'", f.latin1());
     }
     return newSort;
 }

--- src/sql/qsqlrecord.cpp	Mon Jul 16 10:45:03 CEST 2007
+++ src/sql/qsqlrecord.cpp	Mon Jul 16 10:45:03 CEST 2007

@@ -298,7 +298,7 @@
 	    return i;
     }
 #ifdef QT_CHECK_RANGE
-    qWarning( "QSqlRecord::position: unable to find field " + name );
+    qWarning( "QSqlRecord::position: unable to find field %s", name.latin1() );
 #endif
     return -1;
 }
@@ -313,7 +313,7 @@
     checkDetach();
     if ( !sh->d->contains( i ) ) {
 #ifdef QT_CHECK_RANGE
-	qWarning( "QSqlRecord::field: index out of range: " + QString::number( i ) );
+	qWarning( "QSqlRecord::field: index out of range: %d", i );
 #endif
 	return 0;
     }
@@ -344,7 +344,7 @@
 {
     if ( !sh->d->contains( i ) ) {
 #ifdef QT_CHECK_RANGE
-	qWarning( "QSqlRecord::field: index out of range: " + QString::number( i ) );
+	qWarning( "QSqlRecord::field: index out of range: %d", i  );
 #endif // QT_CHECK_RANGE
 	return 0;
     }

--- src/tools/qglobal.cpp	Mon Jul 16 10:45:03 CEST 2007
+++ src/tools/qglobal.cpp	Mon Jul 16 10:45:03 CEST 2007

@@ -680,7 +680,7 @@
     if ( code != -1 )
 	qWarning( "%s\n\tError code %d - %s", msg, code, strerror( code ) );
     else
-	qWarning( msg );
+	qWarning( "%s", msg );
 #endif
 #else
     Q_UNUSED( msg );

--- src/xml/qsvgdevice.cpp	Mon Jul 16 10:45:03 CEST 2007
+++ src/xml/qsvgdevice.cpp	Mon Jul 16 10:45:03 CEST 2007

@@ -978,7 +978,7 @@
 		// ### catch references to embedded .svg files
 		QPixmap pix;
 		if ( !pix.load( href ) ) {
-		    qWarning( "QSvgDevice::play: Couldn't load image "+href );
+		    qWarning( "QSvgDevice::play: Couldn't load image %s", href.latin1() );
 		    break;
 		}
 		pt->drawPixmap( QRect( x1, y1, w, h ), pix );
@@ -1024,8 +1024,8 @@
                 break;
 	    }
 	case InvalidElement:
-	    qWarning( "QSvgDevice::play: unknown element type " +
-		      node.nodeName() );
+	    qWarning( "QSvgDevice::play: unknown element type %s",
+		      node.nodeName().latin1() );
 	    break;
 	};
 
@@ -1111,7 +1111,7 @@
 {
     QRegExp reg( QString::fromLatin1("([+-]?\\d*\\.*\\d*[Ee]?[+-]?\\d*)(em|ex|px|%|pt|pc|cm|mm|in|)$") );
     if ( reg.search( str ) == -1 ) {
-	qWarning( "QSvgDevice::parseLen: couldn't parse " + str );
+	qWarning( "QSvgDevice::parseLen: couldn't parse %s ", str.latin1() );
 	if ( ok )
 	    *ok = FALSE;
 	return 0.0;
@@ -1140,7 +1140,7 @@
 	else if ( u == "pc" )
 	    dbl *= m.logicalDpiX() / 6.0;
 	else
-	    qWarning( "QSvgDevice::parseLen: Unknown unit " + u );
+	    qWarning( "QSvgDevice::parseLen: Unknown unit %s",  u.latin1() );
     }
     if ( ok )
 	*ok = TRUE;