diff options
author | Steve Block <steveblock@google.com> | 2009-08-13 14:06:24 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-08-13 17:39:31 +0100 |
commit | df025453496a4d62bc2819ca50036f9498357dbb (patch) | |
tree | 6ded2d9aca1dea51ac6617ac2a33b24808701aeb /WebCore | |
parent | 9ed228a1884b7bb7ec3896c0b3487c5ea45ec6bd (diff) | |
download | external_webkit-df025453496a4d62bc2819ca50036f9498357dbb.zip external_webkit-df025453496a4d62bc2819ca50036f9498357dbb.tar.gz external_webkit-df025453496a4d62bc2819ca50036f9498357dbb.tar.bz2 |
Fix a couple of bugs in SecurityOrigin when parsing database identifiers.
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/page/SecurityOrigin.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp index 187ec31..f18f6a9 100644 --- a/WebCore/page/SecurityOrigin.cpp +++ b/WebCore/page/SecurityOrigin.cpp @@ -250,15 +250,16 @@ PassRefPtr<SecurityOrigin> SecurityOrigin::createFromDatabaseIdentifier(const St if (separator2 == -1) return create(KURL()); - // Ensure there were at least 2 seperator characters. Some hostnames on intranets have + // Ensure there were at least 2 separator characters. Some hostnames on intranets have // underscores in them, so we'll assume that any additional underscores are part of the host. - if (separator1 != separator2) + if (separator1 == separator2) return create(KURL()); // Make sure the port section is a valid port number or doesn't exist bool portOkay; int port = databaseIdentifier.right(databaseIdentifier.length() - separator2 - 1).toInt(&portOkay); - if (!portOkay && separator2 + 1 == static_cast<int>(databaseIdentifier.length())) + bool portAbsent = (separator2 == static_cast<int>(databaseIdentifier.length()) - 1); + if (!(portOkay || portAbsent)) return create(KURL()); if (port < 0 || port > 65535) |