Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb don't memcpy overlapping buffers, use memmove.
details: https://anonhg.NetBSD.org/src/rev/08b0c49fae6f
branches: trunk
changeset: 350760:08b0c49fae6f
user: maya <maya%NetBSD.org@localhost>
date: Fri Jan 20 02:25:24 2017 +0000
description:
don't memcpy overlapping buffers, use memmove.
this is undefined behaviour.
CID 1299069
diffstat:
sys/dev/usb/ukbd.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 82dafb0b2760 -r 08b0c49fae6f sys/dev/usb/ukbd.c
--- a/sys/dev/usb/ukbd.c Fri Jan 20 02:22:42 2017 +0000
+++ b/sys/dev/usb/ukbd.c Fri Jan 20 02:25:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ukbd.c,v 1.135 2017/01/20 02:22:42 maya Exp $ */
+/* $NetBSD: ukbd.c,v 1.136 2017/01/20 02:25:24 maya Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.135 2017/01/20 02:22:42 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.136 2017/01/20 02:25:24 maya Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -1004,7 +1004,7 @@
sc->sc_flags &= ~FLAG_POLLING;
c = sc->sc_pollchars[0];
sc->sc_npollchar--;
- memcpy(sc->sc_pollchars, sc->sc_pollchars+1,
+ memmove(sc->sc_pollchars, sc->sc_pollchars+1,
sc->sc_npollchar * sizeof(uint16_t));
*type = c & RELEASE ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
*data = c & CODEMASK;
Home |
Main Index |
Thread Index |
Old Index