Commit 55edfc88 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dinput: Ensure buffer doesn't overflow (Coverity).

parent c2a8f3d8
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment