shell32: shlfileop tests: avoid buffer overflows for paths
Mikołaj Zalewski
mikolaj at zalewski.pl
Mon Feb 5 07:12:13 CST 2007
>> @@ -329,8 +329,8 @@ static void test_delete(void)
>> static void test_rename(void)
>> {
>> SHFILEOPSTRUCTA shfo, shfo2;
>> - CHAR from[MAX_PATH];
>> - CHAR to[MAX_PATH];
>> + CHAR from[5*MAX_PATH];
>> + CHAR to[5*MAX_PATH];
>> DWORD retval;
>>
>> shfo.hwnd = NULL;
>>
>
> This is really hacky. If this is fixed, it needs to be fixed properly.
>
I thought this is enough - we never put more that three paths in the
buffer and tester probably won't have paths longer than MAX_PATH as they
are not supported by the shell.
What do you mean by a proper fix - some overflow checking in
set_curr_dir_path and skipping the rest of tests in such a case?
Mikolaj Zalewski
More information about the wine-devel
mailing list