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
4aebd6a9
Commit
4aebd6a9
authored
Feb 28, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allow final null in RtlNormalizeString() even if 0 is an invalid character.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5d270e59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
locale.c
dlls/kernel32/tests/locale.c
+0
-1
locale.c
dlls/ntdll/locale.c
+8
-0
No files found.
dlls/kernel32/tests/locale.c
View file @
4aebd6a9
...
@@ -4521,7 +4521,6 @@ static void test_IdnToNameprepUnicode(void)
...
@@ -4521,7 +4521,6 @@ static void test_IdnToNameprepUnicode(void)
int
len
=
ARRAY_SIZE
(
buf
);
int
len
=
ARRAY_SIZE
(
buf
);
memset
(
buf
,
0xcc
,
sizeof
(
buf
)
);
memset
(
buf
,
0xcc
,
sizeof
(
buf
)
);
status
=
pRtlNormalizeString
(
13
,
test_data
[
i
].
in
,
test_data
[
i
].
in_len
,
buf
,
&
len
);
status
=
pRtlNormalizeString
(
13
,
test_data
[
i
].
in
,
test_data
[
i
].
in_len
,
buf
,
&
len
);
todo_wine_if
(
!
test_data
[
i
].
status
&&
(
test_data
[
i
].
in_len
==
-
1
||
!
test_data
[
i
].
in
[
test_data
[
i
].
in_len
-
1
]))
ok
(
status
==
test_data
[
i
].
status
||
broken
(
status
==
test_data
[
i
].
broken_status
),
ok
(
status
==
test_data
[
i
].
status
||
broken
(
status
==
test_data
[
i
].
broken_status
),
"%d: failed %x
\n
"
,
i
,
status
);
"%d: failed %x
\n
"
,
i
,
status
);
if
(
!
status
)
ok
(
!
wcsncmp
(
test_data
[
i
].
out
,
buf
,
len
),
"%d: buf = %s
\n
"
,
i
,
wine_dbgstr_wn
(
buf
,
len
));
if
(
!
status
)
ok
(
!
wcsncmp
(
test_data
[
i
].
out
,
buf
,
len
),
"%d: buf = %s
\n
"
,
i
,
wine_dbgstr_wn
(
buf
,
len
));
...
...
dlls/ntdll/locale.c
View file @
4aebd6a9
...
@@ -437,6 +437,12 @@ static NTSTATUS decompose_string( const struct norm_table *info, const WCHAR *sr
...
@@ -437,6 +437,12 @@ static NTSTATUS decompose_string( const struct norm_table *info, const WCHAR *sr
props
=
get_char_props
(
info
,
ch
);
props
=
get_char_props
(
info
,
ch
);
if
(
!
(
decomp
=
get_decomposition
(
info
,
ch
,
props
,
buffer
,
&
decomp_len
)))
if
(
!
(
decomp
=
get_decomposition
(
info
,
ch
,
props
,
buffer
,
&
decomp_len
)))
{
{
/* allow final null */
if
(
!
ch
&&
src_pos
==
src_len
-
1
&&
dst_pos
<
*
dst_len
)
{
dst
[
dst_pos
++
]
=
0
;
break
;
}
*
dst_len
=
src_pos
;
*
dst_len
=
src_pos
;
return
STATUS_NO_UNICODE_TRANSLATION
;
return
STATUS_NO_UNICODE_TRANSLATION
;
}
}
...
@@ -1934,6 +1940,8 @@ NTSTATUS WINAPI RtlIsNormalizedString( ULONG form, const WCHAR *str, INT len, BO
...
@@ -1934,6 +1940,8 @@ NTSTATUS WINAPI RtlIsNormalizedString( ULONG form, const WCHAR *str, INT len, BO
/* ignore other chars in Hangul range */
/* ignore other chars in Hangul range */
if
(
ch
>=
HANGUL_LBASE
&&
ch
<
HANGUL_LBASE
+
0x100
)
continue
;
if
(
ch
>=
HANGUL_LBASE
&&
ch
<
HANGUL_LBASE
+
0x100
)
continue
;
if
(
ch
>=
HANGUL_SBASE
&&
ch
<
HANGUL_SBASE
+
0x2c00
)
continue
;
if
(
ch
>=
HANGUL_SBASE
&&
ch
<
HANGUL_SBASE
+
0x2c00
)
continue
;
/* allow final null */
if
(
!
ch
&&
i
==
len
-
1
)
continue
;
return
STATUS_NO_UNICODE_TRANSLATION
;
return
STATUS_NO_UNICODE_TRANSLATION
;
}
}
}
}
...
...
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