Marcus Meissner : mshtml: Fixed buffer size to WideCharToMultiByte.

Alexandre Julliard julliard at winehq.org
Thu Jul 4 15:53:47 CDT 2019


Module: wine
Branch: master
Commit: 201d13a3c31131f204f89d61be37bf75d58dc6dd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=201d13a3c31131f204f89d61be37bf75d58dc6dd

Author: Marcus Meissner <meissner at suse.de>
Date:   Thu Jul  4 17:22:29 2019 +0200

mshtml: Fixed buffer size to WideCharToMultiByte.

Signed-off-by: Marcus Meissner <meissner at suse.de>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/tests/dom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 92c79b7..ff7c62b 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -566,7 +566,7 @@ static const elem_type_info_t elem_type_infos[] = {
 static int strncmp_wa(LPCWSTR strw, const char *stra, size_t len)
 {
     WCHAR buf[512];
-    size_t wlen = MultiByteToWideChar(CP_ACP, 0, stra, len, buf, sizeof(buf));
+    size_t wlen = MultiByteToWideChar(CP_ACP, 0, stra, len, buf, ARRAY_SIZE(buf));
     return wlen == len && memcmp(strw, buf, len * sizeof(WCHAR));
 }
 
@@ -580,7 +580,7 @@ static BOOL is_prefix_wa(const WCHAR *strw, const char *prefix)
     int len, prefix_len;
     CHAR buf[512];
 
-    len = WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL)-1;
+    len = WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, ARRAY_SIZE(buf), NULL, NULL)-1;
     prefix_len = lstrlenA(prefix);
     if(len < prefix_len)
         return FALSE;




More information about the wine-cvs mailing list