Michael Stefaniuc : comctl32/tests: Don't read past the end of the buffer.

Alexandre Julliard julliard at winehq.org
Wed Oct 23 15:31:32 CDT 2019


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

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed Oct 23 21:51:08 2019 +0200

comctl32/tests: Don't read past the end of the buffer.

Fixes test failures uncovered by f8979fee1fa2e6aeed5a5026465dffa680c0848f.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/pager.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c
index 30005c88fa..fba3cb8bef 100644
--- a/dlls/comctl32/tests/pager.c
+++ b/dlls/comctl32/tests/pager.c
@@ -1010,8 +1010,9 @@ static void test_notify_generic_text_helper(HWND pager, const struct generic_tex
             if (data->return_text)
             {
                 if (para->flags & CONVERT_RECEIVE)
-                    ok(!lstrcmpW(data->return_text, *para->text), "Code 0x%08x sub test %d expect %s, got %s\n",
-                       para->code_unicode, i, wine_dbgstr_w((WCHAR *)data->return_text), wine_dbgstr_w(*para->text));
+                    ok(!wcsncmp(data->return_text, *para->text, *para->text_max),
+                       "Code 0x%08x sub test %d expect %s, got %s\n", para->code_unicode, i,
+                       wine_dbgstr_w((WCHAR *)data->return_text), wine_dbgstr_w(*para->text));
                 else
                     ok(!lstrcmpA(data->return_text, (CHAR *)*para->text), "Code 0x%08x sub test %d expect %s, got %s\n",
                        para->code_unicode, i, (CHAR *)data->return_text, (CHAR *)*para->text);




More information about the wine-cvs mailing list