Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2018 18:31:15 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336615 - head/sys/dev/ocs_fc
Message-ID:  <201807221831.w6MIVFgv002708@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sun Jul 22 18:31:15 2018
New Revision: 336615
URL: https://svnweb.freebsd.org/changeset/base/336615

Log:
  Use the right buffer size when calling snprintf().
  
  PR:	229952

Modified:
  head/sys/dev/ocs_fc/ocs_ioctl.c

Modified: head/sys/dev/ocs_fc/ocs_ioctl.c
==============================================================================
--- head/sys/dev/ocs_fc/ocs_ioctl.c	Sun Jul 22 18:07:08 2018	(r336614)
+++ head/sys/dev/ocs_fc/ocs_ioctl.c	Sun Jul 22 18:31:15 2018	(r336615)
@@ -1080,7 +1080,7 @@ ocs_sysctl_init(ocs_t *ocs)
 	struct sysctl_oid *tree = device_get_sysctl_tree(ocs->dev);
 	struct sysctl_oid *vtree; 
 	const char *str = NULL;
-	char sli_intf[16], name[16];
+	char name[16];
 	uint32_t rev, if_type, family, i;
 	ocs_fcport *fcp = NULL;
 
@@ -1120,7 +1120,7 @@ ocs_sysctl_init(ocs_t *ocs)
 			0, "Firmware Revision");
 
 	memset(ocs->sli_intf, 0, sizeof(ocs->sli_intf));
-	snprintf(ocs->sli_intf, sizeof(sli_intf), "%08x",
+	snprintf(ocs->sli_intf, sizeof(ocs->sli_intf), "%08x",
 		 ocs_config_read32(ocs, SLI4_INTF_REG));
 	SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
 			  "sli_intf", CTLFLAG_RD,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807221831.w6MIVFgv002708>