dinput: Ensure buffer doesn't overflow (Coverity).
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c2a8f3d8a0
commit
55edfc8837
|
@ -700,7 +700,7 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo(
|
|||
/* we only support traditional joysticks for now */
|
||||
pdidi->dwDevType = This->devcaps.dwDevType;
|
||||
snprintf(pdidi->tszInstanceName, MAX_PATH, "Joystick %d", index);
|
||||
strcpy(pdidi->tszProductName, This->name);
|
||||
lstrcpynA(pdidi->tszProductName, This->name, MAX_PATH);
|
||||
if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3A)) {
|
||||
pdidi->guidFFDriver = GUID_NULL;
|
||||
pdidi->wUsagePage = 0;
|
||||
|
|
|
@ -411,8 +411,8 @@ static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver
|
|||
lpddi->guidInstance = lpddiW.guidInstance;
|
||||
lpddi->guidProduct = lpddiW.guidProduct;
|
||||
lpddi->dwDevType = lpddiW.dwDevType;
|
||||
strcpy(lpddi->tszInstanceName, joydevs[id].name);
|
||||
strcpy(lpddi->tszProductName, joydevs[id].name);
|
||||
lstrcpynA(lpddi->tszInstanceName, joydevs[id].name, MAX_PATH);
|
||||
lstrcpynA(lpddi->tszProductName, joydevs[id].name, MAX_PATH);
|
||||
lpddi->guidFFDriver = lpddiW.guidFFDriver;
|
||||
lpddi->wUsagePage = lpddiW.wUsagePage;
|
||||
lpddi->wUsage = lpddiW.wUsage;
|
||||
|
|
Loading…
Reference in New Issue