Module: wine Branch: master Commit: 7e2228f15aa7a6fc0d63fe36c34906035422e95a URL: http://source.winehq.org/git/wine.git/?a=commit;h=7e2228f15aa7a6fc0d63fe36c3...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Mar 8 21:06:31 2007 +0100
advapi32: Fixed registry test that failed because of a buffer overflow.
---
dlls/advapi32/tests/registry.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index c016f6f..283da34 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -754,7 +754,6 @@ static void test_reg_query_value(void) LONG size, ret;
static const WCHAR expected[] = {'d','a','t','a',0}; - static const WCHAR set[] = {'d','a','t','a'};
ret = RegCreateKeyA(hkey_main, "subkey", &subkey); ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret); @@ -845,19 +844,16 @@ static void test_reg_query_value(void) ok(size == sizeof(expected), "Got wrong size: %d\n", size);
/* unicode - set the value without a NULL terminator */ - ret = RegSetValueW(subkey, NULL, REG_SZ, set, sizeof(set)); + ret = RegSetValueW(subkey, NULL, REG_SZ, expected, sizeof(expected)-sizeof(WCHAR)); ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
/* unicode - read the unterminated value, value is terminated for us */ memset(valW, 'a', sizeof(valW)); size = sizeof(valW); ret = RegQueryValueW(subkey, NULL, valW, &size); - todo_wine - { - ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret); - ok(!lstrcmpW(valW, expected), "Got wrong value\n"); - ok(size == sizeof(expected), "Got wrong size: %d\n", size); - } + ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret); + ok(!lstrcmpW(valW, expected), "Got wrong value\n"); + ok(size == sizeof(expected), "Got wrong size: %d\n", size);
RegDeleteKeyA(subkey, ""); }