webservices: Reset the read position if an opening bracket is not followed by a valid name character.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2016-04-06 15:55:53 +02:00 committed by Alexandre Julliard
parent ad2fe7e9a2
commit a73701aec2
1 changed files with 10 additions and 0 deletions

View File

@ -919,6 +919,11 @@ static inline void read_skip( struct reader *reader, unsigned int count )
reader->read_pos += count; reader->read_pos += count;
} }
static inline void read_rewind( struct reader *reader, unsigned int count )
{
reader->read_pos -= count;
}
static inline BOOL read_isnamechar( unsigned int ch ) static inline BOOL read_isnamechar( unsigned int ch )
{ {
/* FIXME: incomplete */ /* FIXME: incomplete */
@ -1179,6 +1184,11 @@ static HRESULT read_element( struct reader *reader )
if (read_cmp( reader, "<", 1 )) goto error; if (read_cmp( reader, "<", 1 )) goto error;
read_skip( reader, 1 ); read_skip( reader, 1 );
if (!read_isnamechar( read_utf8_char( reader, &skip )))
{
read_rewind( reader, 1 );
goto error;
}
start = read_current_ptr( reader ); start = read_current_ptr( reader );
for (;;) for (;;)