Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Check the length of a passed name to avoid slient t...
details: https://anonhg.NetBSD.org/src/rev/ef9e39f33b47
branches: trunk
changeset: 359269:ef9e39f33b47
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Tue Feb 06 03:48:39 2018 +0000
description:
Check the length of a passed name to avoid slient truncation
diffstat:
sys/kern/subr_workqueue.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r 9bf09d9bb923 -r ef9e39f33b47 sys/kern/subr_workqueue.c
--- a/sys/kern/subr_workqueue.c Tue Feb 06 03:37:00 2018 +0000
+++ b/sys/kern/subr_workqueue.c Tue Feb 06 03:48:39 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_workqueue.c,v 1.35 2018/01/30 11:03:06 ozaki-r Exp $ */
+/* $NetBSD: subr_workqueue.c,v 1.36 2018/02/06 03:48:39 ozaki-r Exp $ */
/*-
* Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.35 2018/01/30 11:03:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.36 2018/02/06 03:48:39 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -149,6 +149,7 @@
pri_t prio, int ipl)
{
+ KASSERT(sizeof(wq->wq_name) > strlen(name));
strncpy(wq->wq_name, name, sizeof(wq->wq_name));
wq->wq_prio = prio;
Home |
Main Index |
Thread Index |
Old Index