Eric Pouech : msvcr90: Fix an integer overflow on 64 bit system for qsort_s tests.
Alexandre Julliard
julliard at winehq.org
Mon Dec 27 10:03:53 CST 2010
Module: wine
Branch: master
Commit: cecddb321628e80d416b40a2f2eac2fded9dcb31
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cecddb321628e80d416b40a2f2eac2fded9dcb31
Author: Eric Pouech <eric.pouech at orange.fr>
Date: Sun Dec 26 18:00:20 2010 +0100
msvcr90: Fix an integer overflow on 64 bit system for qsort_s tests.
---
dlls/msvcr90/tests/msvcr90.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c
index 449c0bc..24a6517 100644
--- a/dlls/msvcr90/tests/msvcr90.c
+++ b/dlls/msvcr90/tests/msvcr90.c
@@ -509,7 +509,7 @@ static void test_qsort_s(void)
/* overflow without side effects, other overflow values crash */
g_qsort_s_context_counter = 0;
- p_qsort_s((void*)arr2, (1 << (8*sizeof(size_t) - 1)) + 1, sizeof(int), intcomparefunc, &g_qsort_s_context_counter);
+ p_qsort_s((void*)arr2, (((size_t)1) << (8*sizeof(size_t) - 1)) + 1, sizeof(int), intcomparefunc, &g_qsort_s_context_counter);
ok(g_qsort_s_context_counter == 0, "callback shouldn't have been called\n");
ok(arr2[0] == 23, "should remain unsorted, arr2[0] is %d\n", arr2[0]);
ok(arr2[1] == 42, "should remain unsorted, arr2[1] is %d\n", arr2[1]);
More information about the wine-cvs
mailing list