WebKit should treat port numbers outside the valid range as being blacklisted
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Mar 2010 05:26:14 +0000 (05:26 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Mar 2010 05:26:14 +0000 (05:26 +0000)
commitdefbeacbbd529f626548edbaad0f41f0d82b53f3
treeb641932f2404433c1512cb753b9de74e6b805fcd
parent4795c919c26593bc12f38afdd7bd164118cdce29
WebKit should treat port numbers outside the valid range as being blacklisted
<http://webkit.org/b/36571> / <rdar://problem/7790908>

Reviewed by Darin Adler.

WebCore:

* platform/KURL.cpp:
(WebCore::KURL::port): Map invalid port numbers to invalidPortNumber.
(WebCore::portAllowed): Add invalidPortNumber to the blacklist.
* platform/KURLGoogle.cpp:  invalid port numbers to invalidPortNumber.
(WebCore::KURL::port): Add invalidPortNumber to the blacklist.
Also bring this in to sync with KURL.  Having this identical code in two places is stupid.

LayoutTests:

* platform/mac/security/block-test-expected.txt:
* security/block-test.html: Add tests of a few invalid port numbers.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@56489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/security/block-test-expected.txt
LayoutTests/security/block-test.html
WebCore/ChangeLog
WebCore/platform/KURL.cpp
WebCore/platform/KURLGoogle.cpp