Changeset 58219 in webkit
- Timestamp:
- Apr 24, 2010 9:40:49 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r58218 r58219 1 2010-04-24 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 protocolHostAndPortEquals host check makes a wrong assumption 6 https://bugs.webkit.org/show_bug.cgi?id=37777 7 8 Add a check that the URL with credential matches the current URL. 9 10 * http/tests/appcache/credential-url-expected.txt: Added. 11 * http/tests/appcache/credential-url.html: Added. 12 1 13 2010-04-20 Robert Hogan <robert@webkit.org> 2 14 -
trunk/WebCore/ChangeLog
r58214 r58219 1 2010-04-24 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 protocolHostAndPortEquals host check makes a wrong assumption 6 https://bugs.webkit.org/show_bug.cgi?id=37777 7 8 The host check assumed that both host started at the same position. This is true 9 if both URL are the same but sometimes one has credential and the other does not. 10 In this case, the method would compare invalid positions. 11 12 Test: http/tests/appcache/credential-url.html 13 14 * platform/KURL.cpp: 15 (WebCore::protocolHostAndPortAreEqual): 16 * platform/KURLGoogle.cpp: 17 (WebCore::protocolHostAndPortAreEqual): 18 Fix the host check to take both URL's credential into account. 19 1 20 2010-04-24 Nikolas Zimmermann <nzimmermann@rim.com> 2 21 -
trunk/WebCore/platform/KURL.cpp
r56879 r58219 1354 1354 if (a.m_schemeEnd != b.m_schemeEnd) 1355 1355 return false; 1356 1356 1357 int hostStartA = a.hostStart(); 1358 int hostLengthA = a.hostEnd() - hostStartA; 1357 1359 int hostStartB = b.hostStart(); 1358 if (a.m_hostEnd - hostStartA != b.m_hostEnd - hostStartB) 1360 int hostLengthB = b.hostEnd() - b.hostStart(); 1361 if (hostLengthA != hostLengthB) 1359 1362 return false; 1360 1363 … … 1363 1366 if (a.string()[i] != b.string()[i]) 1364 1367 return false; 1365 1368 1366 1369 // And the host 1367 for (int i = hostStartA; i < a.m_hostEnd; ++i)1368 if (a.string()[ i] != b.string()[i])1370 for (int i = 0; i < hostLengthA; ++i) 1371 if (a.string()[hostStartA + i] != b.string()[hostStartB + i]) 1369 1372 return false; 1370 1373 1371 1374 if (a.port() != b.port()) 1372 1375 return false; … … 1374 1377 return true; 1375 1378 } 1376 1377 1379 1378 1380 String encodeWithURLEscapeSequences(const String& notEncodedString) -
trunk/WebCore/platform/KURLGoogle.cpp
r57101 r58219 1145 1145 1146 1146 int hostStartA = a.hostStart(); 1147 int hostLengthA = a.hostEnd() - hostStartA; 1147 1148 int hostStartB = b.hostStart(); 1148 if (a.hostEnd() - hostStartA != b.hostEnd() - hostStartB) 1149 int hostLengthB = b.hostEnd() - b.hostStart(); 1150 if (hostLengthA != hostLengthB) 1149 1151 return false; 1150 1152 … … 1155 1157 1156 1158 // And the host 1157 for (int i = hostStartA; i < static_cast<int>(a.hostEnd()); ++i)1158 if (a.string()[ i] != b.string()[i])1159 for (int i = 0; i < hostLengthA; ++i) 1160 if (a.string()[hostStartA + i] != b.string()[hostStartB + i]) 1159 1161 return false; 1160 1162
Note: See TracChangeset
for help on using the changeset viewer.