[PATCH 2/2] setupapi: Fix an off by one error.
Zebediah Figura
z.figura12 at gmail.com
Wed Feb 27 09:49:38 CST 2019
On 2/27/19 8:44 AM, Zhiyi Zhang wrote:
> Although RegSetValueExW will add a NULL character if it's missing,
> better do it right.
>
> Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
> ---
> dlls/setupapi/devinst.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
> index 46987c8eb9..cc21839049 100644
> --- a/dlls/setupapi/devinst.c
> +++ b/dlls/setupapi/devinst.c
> @@ -1583,7 +1583,7 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(HDEVINFO devinfo, const WCHAR *name, const
> if (description)
> {
> SETUPDI_SetDeviceRegistryPropertyW(device, SPDRP_DEVICEDESC,
> - (const BYTE *)description, lstrlenW(description) * sizeof(WCHAR));
> + (const BYTE *)description, (lstrlenW(description) + 1) * sizeof(WCHAR));
> }
>
> if (device_data)
>
Is there any particular reason why this is better?
More information about the wine-devel
mailing list