Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
267a5658
Commit
267a5658
authored
Feb 12, 2024
by
Bernhard Übelacker
Committed by
Alexandre Julliard
Feb 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Avoid crash in InternetCreateUrl with scheme unknown.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=33050
parent
ceea01b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
internet.c
dlls/wininet/internet.c
+6
-0
url.c
dlls/wininet/tests/url.c
+15
-0
No files found.
dlls/wininet/internet.c
View file @
267a5658
...
...
@@ -4405,6 +4405,12 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents,
{
LPCWSTR
scheme
;
if
(
lpUrlComponents
->
nScheme
==
INTERNET_SCHEME_UNKNOWN
)
{
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
nScheme
=
lpUrlComponents
->
nScheme
;
if
(
nScheme
==
INTERNET_SCHEME_DEFAULT
)
...
...
dlls/wininet/tests/url.c
View file @
267a5658
...
...
@@ -1231,6 +1231,21 @@ static void InternetCreateUrlA_test(void)
ok
(
!
strcmp
(
szUrl
,
CREATE_URL13
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
CREATE_URL13
,
szUrl
);
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
fill_url_components
(
&
urlComp
);
urlComp
.
lpszScheme
=
NULL
;
urlComp
.
dwSchemeLength
=
0
;
urlComp
.
nScheme
=
INTERNET_SCHEME_UNKNOWN
;
len
=
256
;
szUrl
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
SetLastError
(
0xdeadbeef
);
ret
=
InternetCreateUrlA
(
&
urlComp
,
0
,
szUrl
,
&
len
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
}
static
void
InternetCanonicalizeUrl_test
(
void
)
...
...
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