[ros-dev] [ros-diffs] [cgutman] 50077: [USBDRIVER] - Fix a bug that resulted in us onl
Pierre Schweitzer
pierre.schweitzer at reactos.org
Mon Dec 27 16:15:12 UTC 2010
Hi,
> Author: cgutman
> Date: Tue Dec 21 04:35:12 2010
> New Revision: 50077
>
> URL: http://svn.reactos.org/svn/reactos?rev=50077&view=rev
> Log:
> [USBDRIVER]
> - Fix a bug that resulted in us only copying half of the old keyboard data
> - CID 10402
>
> Modified:
> trunk/reactos/drivers/usb/nt4compat/usbdriver/keyboard.c
>
> Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/keyboard.c
> URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdriver/keyboard.c?rev=50077&r1=50076&r2=50077&view=diff
> ==============================================================================
> --- trunk/reactos/drivers/usb/nt4compat/usbdriver/keyboard.c [iso-8859-1] (original)
> +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/keyboard.c [iso-8859-1] Tue Dec 21 04:35:12 2010
> @@ -277,7 +277,7 @@
> }
>
> // Save old keyboard data
> - RtlCopyMemory(pdev_ext->kbd_old, data, sizeof(data));
> + RtlCopyMemory(pdev_ext->kbd_old, data, 8);
>
> // resubmit the urb
> status = usb_submit_urb(pdev_ext->dev_mgr, purb);
This change is really dangerous and should be changed to a correct fix. Using magic values on memory copying is a bad idea. Using magic values (in general) is a bad idea.
Please provide a better fix without magic value.
Regards,
P. Schweitzer
More information about the Ros-dev
mailing list