Module Name:    src
Committed By:   maya
Date:           Sat Mar 11 12:41:14 UTC 2017

Modified Files:
        src/sys/dev/usb: uhid.c

Log Message:
memcpy of overlapping arguments is UB. use memmove.
CID 1299071

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/usb/uhid.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uhid.c
diff -u src/sys/dev/usb/uhid.c:1.98 src/sys/dev/usb/uhid.c:1.99
--- src/sys/dev/usb/uhid.c:1.98	Thu Jul  7 06:55:42 2016
+++ src/sys/dev/usb/uhid.c	Sat Mar 11 12:41:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhid.c,v 1.98 2016/07/07 06:55:42 msaitoh Exp $	*/
+/*	$NetBSD: uhid.c,v 1.99 2017/03/11 12:41:14 maya Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2008, 2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.98 2016/07/07 06:55:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.99 2017/03/11 12:41:14 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -613,7 +613,7 @@ uhid_do_ioctl(struct uhid_softc *sc, u_l
 		err = uhidev_get_report(&sc->sc_hdev, re->ucr_report,
 		    re->ucr_data, size + extra);
 		if (extra)
-			memcpy(re->ucr_data, re->ucr_data+1, size);
+			memmove(re->ucr_data, re->ucr_data+1, size);
 		if (err)
 			return EIO;
 		break;

Reply via email to