[PATCH v2 2/3] winex11.drv: avoid passing NULL to memcpy (clang)

Alexandre Julliard julliard at winehq.org
Thu Jul 7 22:16:43 CDT 2016


Kirill Smirnov <kirill.k.smirnov at gmail.com> writes:

> @@ -92,7 +92,8 @@ static void X11DRV_ImmSetInternalString(DWORD dwOffset,
>      ptr_new = CompositionString + byte_offset;
>      memmove(ptr_new + byte_length, ptr_new + byte_selection,
>              dwCompStringLength - byte_offset - byte_selection);
> -    memcpy(ptr_new, lpComp, byte_length);
> +    /* Do not pass NULL even if the length == 0 */
> +    if (lpComp) memcpy(ptr_new, lpComp, byte_length);
>      dwCompStringLength += byte_expansion;

Why would that be a problem?

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list