Use the right buffer size when calling snprintf().
PR: 229952
This commit is contained in:
parent
6984a7b8bb
commit
84f0fb8a93
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336615
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user