Commit b6c31bea authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

advapi32: Use STATUS_BUFFER_TOO_SMALL for buffer overflows in RegQueryInfoKeyW.

parent f4790714
......@@ -865,7 +865,7 @@ LSTATUS WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPD
if (class_len && (info->ClassLength/sizeof(WCHAR) + 1 > *class_len))
{
status = STATUS_BUFFER_OVERFLOW;
status = STATUS_BUFFER_TOO_SMALL;
}
else
{
......
......@@ -1823,7 +1823,7 @@ static void test_reg_query_info(void)
memset(classbufferW, 0x55, sizeof(classbufferW));
classlen = 1;
ret = RegQueryInfoKeyW(subkey, classbufferW, &classlen, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
todo_wine ok(ret == ERROR_INSUFFICIENT_BUFFER, "ret = %d\n", ret);
ok(ret == ERROR_INSUFFICIENT_BUFFER, "ret = %d\n", ret);
ok(classlen == 0 /* win8 */ ||
classlen == strlen(subkey_class), "classlen = %u\n", classlen);
memset(expectbufferW, 0x55, sizeof(expectbufferW));
......@@ -1846,7 +1846,7 @@ static void test_reg_query_info(void)
memset(classbufferW, 0x55, sizeof(classbufferW));
classlen = sizeof(subkey_class) - 1;
ret = RegQueryInfoKeyW(subkey, classbufferW, &classlen, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
todo_wine ok(ret == ERROR_INSUFFICIENT_BUFFER, "ret = %d\n", ret);
ok(ret == ERROR_INSUFFICIENT_BUFFER, "ret = %d\n", ret);
ok(classlen == sizeof(subkey_class) - 2 /* win8 */ ||
classlen == strlen(subkey_class), "classlen = %u\n", classlen);
memset(expectbufferW, 0x55, sizeof(expectbufferW));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment