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
dcd195e0
Commit
dcd195e0
authored
Feb 03, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add parameter checking in RtlNormalizeString().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
77f58afd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
locale.c
dlls/kernel32/tests/locale.c
+7
-4
locale.c
dlls/ntdll/locale.c
+12
-3
No files found.
dlls/kernel32/tests/locale.c
View file @
dcd195e0
...
@@ -6184,12 +6184,14 @@ static void test_NormalizeString(void)
...
@@ -6184,12 +6184,14 @@ static void test_NormalizeString(void)
case
NormalizationKC
:
case
NormalizationKC
:
case
NormalizationKD
:
case
NormalizationKD
:
case
13
:
/* Idn */
case
13
:
/* Idn */
todo_wine_if
(
i
==
13
)
ok
(
dstlen
>
0
,
"%d: wrong len %d
\n
"
,
i
,
dstlen
);
ok
(
dstlen
>
0
,
"%d: wrong len %d
\n
"
,
i
,
dstlen
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"%d: got error %u
\n
"
,
i
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"%d: got error %u
\n
"
,
i
,
GetLastError
());
break
;
break
;
default:
default:
todo_wine
ok
(
dstlen
<=
0
,
"%d: wrong len %d
\n
"
,
i
,
dstlen
);
ok
(
dstlen
<=
0
,
"%d: wrong len %d
\n
"
,
i
,
dstlen
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d: got error %u
\n
"
,
i
,
GetLastError
());
todo_wine_if
(
i
)
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d: got error %u
\n
"
,
i
,
GetLastError
());
break
;
break
;
}
}
if
(
pRtlNormalizeString
)
if
(
pRtlNormalizeString
)
...
@@ -6199,17 +6201,18 @@ static void test_NormalizeString(void)
...
@@ -6199,17 +6201,18 @@ static void test_NormalizeString(void)
switch
(
i
)
switch
(
i
)
{
{
case
0
:
case
0
:
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"%d: failed %x
\n
"
,
i
,
status
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"%d: failed %x
\n
"
,
i
,
status
);
break
;
break
;
case
NormalizationC
:
case
NormalizationC
:
case
NormalizationD
:
case
NormalizationD
:
case
NormalizationKC
:
case
NormalizationKC
:
case
NormalizationKD
:
case
NormalizationKD
:
case
13
:
/* Idn */
case
13
:
/* Idn */
todo_wine_if
(
i
==
13
)
ok
(
status
==
STATUS_SUCCESS
,
"%d: failed %x
\n
"
,
i
,
status
);
ok
(
status
==
STATUS_SUCCESS
,
"%d: failed %x
\n
"
,
i
,
status
);
break
;
break
;
default:
default:
todo_wine
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"%d: failed %x
\n
"
,
i
,
status
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"%d: failed %x
\n
"
,
i
,
status
);
break
;
break
;
}
}
}
}
...
...
dlls/ntdll/locale.c
View file @
dcd195e0
...
@@ -1687,17 +1687,26 @@ NTSTATUS WINAPI RtlIsNormalizedString( ULONG form, const WCHAR *str, INT len, BO
...
@@ -1687,17 +1687,26 @@ NTSTATUS WINAPI RtlIsNormalizedString( ULONG form, const WCHAR *str, INT len, BO
*/
*/
NTSTATUS
WINAPI
RtlNormalizeString
(
ULONG
form
,
const
WCHAR
*
src
,
INT
src_len
,
WCHAR
*
dst
,
INT
*
dst_len
)
NTSTATUS
WINAPI
RtlNormalizeString
(
ULONG
form
,
const
WCHAR
*
src
,
INT
src_len
,
WCHAR
*
dst
,
INT
*
dst_len
)
{
{
int
flags
=
0
,
compose
=
0
;
int
flags
=
0
,
compose
,
compat
;
unsigned
int
res
,
buf_len
;
unsigned
int
res
,
buf_len
;
WCHAR
*
buf
=
NULL
;
WCHAR
*
buf
=
NULL
;
NTSTATUS
status
=
STATUS_SUCCESS
;
NTSTATUS
status
=
STATUS_SUCCESS
;
TRACE
(
"%x %s %d %p %d
\n
"
,
form
,
debugstr_wn
(
src
,
src_len
),
src_len
,
dst
,
*
dst_len
);
TRACE
(
"%x %s %d %p %d
\n
"
,
form
,
debugstr_wn
(
src
,
src_len
),
src_len
,
dst
,
*
dst_len
);
switch
(
form
)
{
case
NormalizationC
:
compose
=
1
;
compat
=
0
;
break
;
case
NormalizationD
:
compose
=
0
;
compat
=
0
;
break
;
case
NormalizationKC
:
compose
=
1
;
compat
=
1
;
break
;
case
NormalizationKD
:
compose
=
0
;
compat
=
1
;
break
;
case
0
:
return
STATUS_INVALID_PARAMETER
;
default:
return
STATUS_OBJECT_NAME_NOT_FOUND
;
}
if
(
src_len
==
-
1
)
src_len
=
strlenW
(
src
)
+
1
;
if
(
src_len
==
-
1
)
src_len
=
strlenW
(
src
)
+
1
;
if
(
form
==
NormalizationKC
||
form
==
NormalizationKD
)
flags
|=
WINE_DECOMPOSE_COMPAT
;
if
(
compat
)
flags
|=
WINE_DECOMPOSE_COMPAT
;
if
(
form
==
NormalizationC
||
form
==
NormalizationKC
)
compose
=
1
;
if
(
compose
||
*
dst_len
)
flags
|=
WINE_DECOMPOSE_REORDER
;
if
(
compose
||
*
dst_len
)
flags
|=
WINE_DECOMPOSE_REORDER
;
if
(
!
compose
&&
*
dst_len
)
if
(
!
compose
&&
*
dst_len
)
...
...
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