webservices: Avoid decoding a nul character reference.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2016-10-10 22:53:12 +09:00 committed by Alexandre Julliard
parent c11d931ea3
commit 064edd2d8b
2 changed files with 4 additions and 0 deletions

View File

@ -1166,6 +1166,8 @@ static HRESULT parse_name( const unsigned char *str, unsigned int len,
static int codepoint_to_utf8( int cp, unsigned char *dst )
{
if (!cp)
return -1;
if (cp < 0x80)
{
*dst = cp;

View File

@ -3610,6 +3610,7 @@ static void test_entities(void)
static const char str25[] = "<t>&#xfffe;</t>";
static const char str26[] = "<t>&#xffff;</t>";
static const char str27[] = "<t>&LT;</t>";
static const char str28[] = "<t>&#x0;</t>";
static const char res4[] = {0xea, 0xaa, 0xaa, 0x00};
static const char res5[] = {0xf2, 0xaa, 0xaa, 0xaa, 0x00};
static const char res21[] = {0xed, 0x9f, 0xbf, 0x00};
@ -3649,6 +3650,7 @@ static void test_entities(void)
{ str25, WS_E_INVALID_FORMAT },
{ str26, WS_E_INVALID_FORMAT },
{ str27, WS_E_INVALID_FORMAT },
{ str28, WS_E_INVALID_FORMAT },
};
HRESULT hr;
WS_XML_READER *reader;