Use the right buffer size when calling snprintf().

PR:	229952
This commit is contained in:
Mark Johnston 2018-07-22 18:31:15 +00:00
parent 6984a7b8bb
commit 84f0fb8a93

View File

@ -1080,7 +1080,7 @@ ocs_sysctl_init(ocs_t *ocs)
struct sysctl_oid *tree = device_get_sysctl_tree(ocs->dev); struct sysctl_oid *tree = device_get_sysctl_tree(ocs->dev);
struct sysctl_oid *vtree; struct sysctl_oid *vtree;
const char *str = NULL; const char *str = NULL;
char sli_intf[16], name[16]; char name[16];
uint32_t rev, if_type, family, i; uint32_t rev, if_type, family, i;
ocs_fcport *fcp = NULL; ocs_fcport *fcp = NULL;
@ -1120,7 +1120,7 @@ ocs_sysctl_init(ocs_t *ocs)
0, "Firmware Revision"); 0, "Firmware Revision");
memset(ocs->sli_intf, 0, sizeof(ocs->sli_intf)); 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)); ocs_config_read32(ocs, SLI4_INTF_REG));
SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
"sli_intf", CTLFLAG_RD, "sli_intf", CTLFLAG_RD,