summaryrefslogtreecommitdiffstats
path: root/tests/sys
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-06-14 14:37:21 -0500
committerRenato Botelho <renato@netgate.com>2016-06-14 14:37:21 -0500
commitb8632c4f34175c7018be77059ab229e755eb67e0 (patch)
tree712b8119449ce1d7585aef984d17257bea58bf58 /tests/sys
parent47dfb8d658406ebf07225c0104ebe4be06ae405f (diff)
parent494811e2fb5cf62d613082ffb6e26922a0b5b2e6 (diff)
downloadFreeBSD-src-b8632c4f34175c7018be77059ab229e755eb67e0.zip
FreeBSD-src-b8632c4f34175c7018be77059ab229e755eb67e0.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'tests/sys')
-rw-r--r--tests/sys/kern/kern_descrip_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/sys/kern/kern_descrip_test.c b/tests/sys/kern/kern_descrip_test.c
index 6953b00..07240d7 100644
--- a/tests/sys/kern/kern_descrip_test.c
+++ b/tests/sys/kern/kern_descrip_test.c
@@ -27,6 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/param.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
@@ -170,7 +171,7 @@ ATF_TC_CLEANUP(kern_maxfiles__increase, tc)
char buf[80];
if ((n = readlink(VALUE, buf, sizeof(buf))) > 0) {
- buf[n] = '\0';
+ buf[MIN((size_t)n, sizeof(buf) - 1)] = '\0';
if (sscanf(buf, "%d", &oldmaxfiles) == 1) {
oldlen = sizeof(oldmaxfiles);
(void) sysctlbyname("kern.maxfiles", NULL, 0,
OpenPOWER on IntegriCloud