strncpy should use destination buf length instead of source buf length.

pointed out by nonaka@n.o.
This commit is contained in:
knakahara 2016-07-11 09:42:20 +00:00
parent 16e89468ad
commit 53a51f2a77

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.92 2016/06/20 08:14:06 hannken Exp $ */
/* $NetBSD: intr.c,v 1.93 2016/07/11 09:42:20 knakahara Exp $ */
/*-
* Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@ -133,7 +133,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.92 2016/06/20 08:14:06 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.93 2016/07/11 09:42:20 knakahara Exp $");
#include "opt_intrdebug.h"
#include "opt_multiprocessor.h"
@ -2103,7 +2103,7 @@ interrupt_get_devname(const char *intrid, char *buf, size_t len)
}
slot = ih->ih_slot;
isp = ih->ih_cpu->ci_isources[slot];
strncpy(buf, isp->is_xname, INTRDEVNAMEBUF);
strncpy(buf, isp->is_xname, len);
out:
mutex_exit(&cpu_lock);