Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb memcpy of overlapping arguments is UB. use memmove.
details: https://anonhg.NetBSD.org/src/rev/34f5fc52e352
branches: trunk
changeset: 352036:34f5fc52e352
user: maya <maya%NetBSD.org@localhost>
date: Sat Mar 11 12:41:14 2017 +0000
description:
memcpy of overlapping arguments is UB. use memmove.
CID 1299071
ok riastradh
diffstat:
sys/dev/usb/uhid.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 93b83f190645 -r 34f5fc52e352 sys/dev/usb/uhid.c
--- a/sys/dev/usb/uhid.c Sat Mar 11 12:19:30 2017 +0000
+++ b/sys/dev/usb/uhid.c Sat Mar 11 12:41:14 2017 +0000
@@ -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 @@
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;
Home |
Main Index |
Thread Index |
Old Index