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

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 6 11:12:04 CDT 2016


Module: wine
Branch: master
Commit: a73701aec2ef222afc04e9e7f573dd744694f951
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a73701aec2ef222afc04e9e7f573dd744694f951

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Apr  6 15:55:53 2016 +0200

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

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 (;;)




More information about the wine-cvs mailing list