[01/10] msvcr90/tests: Avoid casting away const and avoid potential overflows in comparison functions.

Marcus Meissner marcus at jet.franken.de
Sat Jan 15 02:53:25 CST 2011


On Sat, Jan 15, 2011 at 02:27:49AM -0600, Andrew Nguyen wrote:
> ---
>  dlls/msvcr90/tests/msvcr90.c |   27 +++++++++++++++++++++------
>  1 files changed, 21 insertions(+), 6 deletions(-)
> 
> 

> diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c
> index 24a6517..9c07d64 100644
> --- a/dlls/msvcr90/tests/msvcr90.c
> +++ b/dlls/msvcr90/tests/msvcr90.c
> @@ -446,25 +446,40 @@ static void test_wcsncat_s(void)
>  }
>  
> -static __cdecl int strcomparefunc(void *context, const void *a, const void*b)
> +static __cdecl int strcomparefunc(void *context, const void *a, const void *b)
>  {
> +    const char *p = a, *q = b;
> +
>      ok (a != b, "must never get the same pointer\n");
>      ++*(int *) context;
> -    return lstrcmpA(*(char**)a,*(char**)b);
> +
> +    return lstrcmpA(p, q);

As testbot wrote, this change is wrong. :)

should be
const char *p = *a, *q = *b;
I guess.

Ciao, Marcus




More information about the wine-devel mailing list