Nikolay Sivov : xmllite: Correct allocated destination buffer size.

Alexandre Julliard julliard at winehq.org
Wed Oct 9 14:22:15 CDT 2013


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Oct  9 15:38:34 2013 +0400

xmllite: Correct allocated destination buffer size.

---

 dlls/xmllite/reader.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c
index ebea0b4..0a4423c 100644
--- a/dlls/xmllite/reader.c
+++ b/dlls/xmllite/reader.c
@@ -711,11 +711,12 @@ static HRESULT readerinput_growraw(xmlreaderinput *readerinput)
     return hr;
 }
 
-/* grows UTF-16 buffer so it has at least 'length' bytes free on return */
+/* grows UTF-16 buffer so it has at least 'length' WCHAR chars free on return */
 static void readerinput_grow(xmlreaderinput *readerinput, int length)
 {
     encoded_buffer *buffer = &readerinput->buffer->utf16;
 
+    length *= sizeof(WCHAR);
     /* grow if needed, plus 4 bytes to be sure null terminator will fit in */
     if (buffer->allocated < buffer->written + length + 4)
     {




More information about the wine-cvs mailing list