From c59370f055cdfe29fa0f13ae2c3cad1f3573016f Mon Sep 17 00:00:00 2001 From: Eric van Gyzen Date: Wed, 21 Oct 2020 17:11:57 +0000 Subject: [PATCH] ntb_tool: ubuf is too small to hold a human readable 64 bit value ubuf buffer is too small. It should be 18 if a NULL is not needed, or 19 to hold the NULL terminator for the full 64-BIT value plus the 0x prefix. Submitted by: bret_ketchum@dell.com Reviewed by: markj mav MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26893 --- sys/dev/ntb/test/ntb_tool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ntb/test/ntb_tool.c b/sys/dev/ntb/test/ntb_tool.c index fc8dd967310..76dfd58695e 100644 --- a/sys/dev/ntb/test/ntb_tool.c +++ b/sys/dev/ntb/test/ntb_tool.c @@ -384,7 +384,7 @@ get_ubuf(struct sysctl_req *req, char *ubuf) static int read_out(struct sysctl_req *req, uint64_t val) { - char ubuf[16]; + char ubuf[19]; memset((void *)ubuf, 0, sizeof(ubuf)); snprintf(ubuf, sizeof(ubuf), "0x%jx", val);