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
9cffed78
Commit
9cffed78
authored
May 16, 2015
by
Christian Faure
Committed by
Alexandre Julliard
May 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix a crash in GetStringTypeW() on NULL input string.
parent
2e213811
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
locale.c
dlls/kernel32/locale.c
+6
-0
locale.c
dlls/kernel32/tests/locale.c
+17
-0
No files found.
dlls/kernel32/locale.c
View file @
9cffed78
...
...
@@ -2732,6 +2732,12 @@ BOOL WINAPI GetStringTypeW( DWORD type, LPCWSTR src, INT count, LPWORD chartype
C2_OTHERNEUTRAL
/* LRE, LRO, RLE, RLO, PDF */
};
if
(
!
src
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
count
==
-
1
)
count
=
strlenW
(
src
)
+
1
;
switch
(
type
)
{
...
...
dlls/kernel32/tests/locale.c
View file @
9cffed78
...
...
@@ -3582,9 +3582,26 @@ static void test_GetStringTypeW(void)
static
const
WCHAR
space_special
[]
=
{
0x09
,
0x0d
,
0x85
};
WORD
types
[
20
];
BOOL
ret
;
WCHAR
ch
;
int
i
;
/* NULL src */
SetLastError
(
0xdeadbeef
);
ret
=
GetStringTypeW
(
CT_CTYPE1
,
NULL
,
0
,
NULL
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
GetStringTypeW
(
CT_CTYPE1
,
NULL
,
0
,
types
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
GetStringTypeW
(
CT_CTYPE1
,
NULL
,
5
,
types
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got error %d
\n
"
,
GetLastError
());
memset
(
types
,
0
,
sizeof
(
types
));
GetStringTypeW
(
CT_CTYPE1
,
blanks
,
5
,
types
);
for
(
i
=
0
;
i
<
5
;
i
++
)
...
...
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