mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 377052 - nsBaseURLParser::ParseURL doesn't handle spaces embedded in the scheme properly r=mcmanus
This commit is contained in:
parent
8fa824bcaf
commit
f2674e1627
@ -62,17 +62,21 @@ nsBaseURLParser::ParseURL(const char *spec, int32_t specLen,
|
||||
const char *stop = nullptr;
|
||||
const char *colon = nullptr;
|
||||
const char *slash = nullptr;
|
||||
const char *p;
|
||||
const char *p = spec;
|
||||
uint32_t offset = 0;
|
||||
int32_t len = specLen;
|
||||
for (p = spec; len && *p && !colon && !slash; ++p, --len) {
|
||||
|
||||
// skip leading whitespace
|
||||
if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') {
|
||||
while (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') {
|
||||
spec++;
|
||||
specLen--;
|
||||
offset++;
|
||||
continue;
|
||||
|
||||
p++;
|
||||
len--;
|
||||
}
|
||||
|
||||
for (; len && *p && !colon && !slash; ++p, --len) {
|
||||
switch (*p) {
|
||||
case ':':
|
||||
if (!colon)
|
||||
|
Loading…
Reference in New Issue
Block a user