ntdll: Allow final null in RtlNormalizeString() even if 0 is an invalid character.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5d270e592d
commit
4aebd6a95f
|
@ -4521,7 +4521,6 @@ static void test_IdnToNameprepUnicode(void)
|
|||
int len = ARRAY_SIZE(buf);
|
||||
memset( buf, 0xcc, sizeof(buf) );
|
||||
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),
|
||||
"%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));
|
||||
|
|
|
@ -437,6 +437,12 @@ static NTSTATUS decompose_string( const struct norm_table *info, const WCHAR *sr
|
|||
props = get_char_props( info, ch );
|
||||
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;
|
||||
return STATUS_NO_UNICODE_TRANSLATION;
|
||||
}
|
||||
|
@ -1934,6 +1940,8 @@ NTSTATUS WINAPI RtlIsNormalizedString( ULONG form, const WCHAR *str, INT len, BO
|
|||
/* ignore other chars in Hangul range */
|
||||
if (ch >= HANGUL_LBASE && ch < HANGUL_LBASE + 0x100) continue;
|
||||
if (ch >= HANGUL_SBASE && ch < HANGUL_SBASE + 0x2c00) continue;
|
||||
/* allow final null */
|
||||
if (!ch && i == len - 1) continue;
|
||||
return STATUS_NO_UNICODE_TRANSLATION;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue