shell32: shlfileop tests: avoid buffer overflows for paths

James Hawkins truiken at gmail.com
Mon Feb 5 02:44:11 CST 2007


On 2/4/07, Mikołaj Zalewski <mikolaj at zalewski.pl> wrote:
> These buffers can contain multiple paths and set_curr_dir_path can make
> the paths long resulting in a buffer overflow.
>
> From 36e05f3140e57bad2af790c56073799d23f7ef60 Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
> Date: Thu, 25 Jan 2007 12:17:11 +0100
> Subject: [PATCH] shell32: shlfileop tests: avoid buffer overflows for paths
>
> ---
>  dlls/shell32/tests/shlfileop.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c
> index b363c5e..23aaeba 100644
> --- a/dlls/shell32/tests/shlfileop.c
> +++ b/dlls/shell32/tests/shlfileop.c
> @@ -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.

-- 
James Hawkins


More information about the wine-devel mailing list