Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6862697a
Commit
6862697a
authored
Jun 22, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Fixed handling empty URIs.
parent
c3c131ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
23 deletions
+74
-23
uri.c
dlls/urlmon/tests/uri.c
+52
-1
uri.c
dlls/urlmon/uri.c
+22
-22
No files found.
dlls/urlmon/tests/uri.c
View file @
6862697a
...
...
@@ -4139,7 +4139,58 @@ static const uri_properties uri_tests[] = {
{
URL_SCHEME_MK
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
}
},
{
""
,
Uri_CREATE_ALLOW_RELATIVE
,
S_OK
,
FALSE
,
{
{
""
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_OK
,
FALSE
},
{
""
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_UNKNOWN
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"
\t
"
,
Uri_CREATE_ALLOW_RELATIVE
,
S_OK
,
FALSE
,
{
{
""
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_OK
,
FALSE
},
{
""
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_UNKNOWN
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
};
typedef
struct
_invalid_uri
{
...
...
dlls/urlmon/uri.c
View file @
6862697a
...
...
@@ -857,35 +857,35 @@ static void compute_elision_location(const ipv6_address *address, const USHORT v
* characters inside of the URI string.
*/
static
BSTR
pre_process_uri
(
LPCWSTR
uri
)
{
BSTR
ret
;
const
WCHAR
*
start
,
*
end
,
*
ptr
;
WCHAR
*
ptr2
;
DWORD
len
;
const
WCHAR
*
start
,
*
end
;
WCHAR
*
buf
,
*
ptr
;
len
=
lstrlenW
(
uri
);
BSTR
ret
;
start
=
uri
;
/* Skip leading controls and whitespace. */
while
(
iscntrlW
(
*
start
)
||
isspaceW
(
*
start
))
++
start
;
while
(
*
start
&&
(
iscntrlW
(
*
start
)
||
isspaceW
(
*
start
)
))
++
start
;
end
=
uri
+
len
-
1
;
if
(
start
==
end
)
/* URI consisted only of control/whitespace. */
ret
=
SysAllocStringLen
(
NULL
,
0
);
else
{
while
(
iscntrlW
(
*
end
)
||
isspaceW
(
*
end
))
--
end
;
/* URI consisted only of control/whitespace. */
if
(
!*
start
)
return
SysAllocStringLen
(
NULL
,
0
);
buf
=
heap_alloc
(((
end
+
1
)
-
start
)
*
sizeof
(
WCHAR
));
if
(
!
buf
)
return
NULL
;
end
=
start
+
strlenW
(
start
);
while
(
--
end
>
start
&&
(
iscntrlW
(
*
end
)
||
isspaceW
(
*
end
)));
for
(
ptr
=
buf
;
start
<
end
+
1
;
++
start
)
{
if
(
!
iscntrlW
(
*
start
))
*
ptr
++
=
*
start
;
}
len
=
++
end
-
start
;
for
(
ptr
=
start
;
ptr
<
end
;
ptr
++
)
{
if
(
iscntrlW
(
*
ptr
))
len
--
;
}
ret
=
SysAllocStringLen
(
NULL
,
len
);
if
(
!
ret
)
return
NULL
;
ret
=
SysAllocStringLen
(
buf
,
ptr
-
buf
);
heap_free
(
buf
);
for
(
ptr
=
start
,
ptr2
=
ret
;
ptr
<
end
;
ptr
++
)
{
if
(
!
iscntrlW
(
*
ptr
))
*
ptr2
++
=
*
ptr
;
}
return
ret
;
...
...
@@ -5096,7 +5096,7 @@ HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IU
if
(
!
ppURI
)
return
E_INVALIDARG
;
if
(
!
pwzURI
||
!*
pwzURI
)
{
if
(
!
pwzURI
)
{
*
ppURI
=
NULL
;
return
E_INVALIDARG
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment