[v2 4/5] webservices: Reset the read position if an opening bracket is not followed by a valid name character.

Hans Leidekker hans at codeweavers.com
Wed Apr 6 08:55:53 CDT 2016


Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/webservices/reader.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c
index f12c118..eb16427 100644
--- a/dlls/webservices/reader.c
+++ b/dlls/webservices/reader.c
@@ -919,6 +919,11 @@ static inline void read_skip( struct reader *reader, unsigned int 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 )
 {
     /* FIXME: incomplete */
@@ -1179,6 +1184,11 @@ static HRESULT read_element( struct reader *reader )
 
     if (read_cmp( reader, "<", 1 )) goto error;
     read_skip( reader, 1 );
+    if (!read_isnamechar( read_utf8_char( reader, &skip )))
+    {
+        read_rewind( reader, 1 );
+        goto error;
+    }
 
     start = read_current_ptr( reader );
     for (;;)
-- 
2.8.0.rc3




More information about the wine-patches mailing list