iscsi: replace uses of sprintf() with snprintf()

Change-Id: Iafee68ca24e330208539a4d0a61596b1dc9f6dd9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-08-08 11:01:17 -07:00
parent cd1377c636
commit c320f79aa6
2 changed files with 3 additions and 3 deletions

View File

@ -146,7 +146,7 @@ int spdk_initialize_iscsi_conns(void)
return -1;
}
sprintf(g_shm_name, "spdk_iscsi_conns.%d", spdk_app_get_instance_id());
snprintf(g_shm_name, sizeof(g_shm_name), "spdk_iscsi_conns.%d", spdk_app_get_instance_id());
conns_array_fd = shm_open(g_shm_name, O_RDWR | O_CREAT, 0600);
if (conns_array_fd < 0) {
SPDK_ERRLOG("could not shm_open %s\n", g_shm_name);

View File

@ -119,7 +119,7 @@ spdk_iscsi_config_dump_section(FILE *fp)
authmethod = "Auto";
if (g_spdk_iscsi.discovery_auth_group)
sprintf(authgroup, "AuthGroup%d", g_spdk_iscsi.discovery_auth_group);
snprintf(authgroup, sizeof(authgroup), "AuthGroup%d", g_spdk_iscsi.discovery_auth_group);
/* FIXME - lookup log facility and put it in place of "local7" below */
fprintf(fp, ISCSI_CONFIG_TMPL,
@ -292,7 +292,7 @@ spdk_iscsi_config_dump_target_nodes(FILE *fp)
authmethod = "CHAP";
if (target->auth_group > 0)
sprintf(authgroup, "AuthGroup%d", target->auth_group);
snprintf(authgroup, sizeof(authgroup), "AuthGroup%d", target->auth_group);
if (target->header_digest)
usedigest = "Header";