Skip to contentSkip to conversation

target/iscsi: Make iscsit_ta_authentication() respect the output buffer size

PATCH Applied Bart Van Assche 1 participant 1 message Jun 22, 2018 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 14/20 target/iscsi: Make iscsit_ta_authentication() respect the output buffer size

Fixes e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Cc Mike Christie <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Hannes Reinecke <[email protected]>
---
 drivers/target/iscsi/iscsi_target_tpg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/target/iscsi/iscsi_target_tpg.c +1 -2
index 4b34f71547c6..101d62105c93 100644
@@ -636,8 +636,7 @@ int iscsit_ta_authentication(struct iscsi_portal_group *tpg, u32 authentication)
 		none = strstr(buf1, NONE);
 		if (none)
 			goto out;
-		strncat(buf1, ",", strlen(","));
-		strncat(buf1, NONE, strlen(NONE));
+		strlcat(buf1, "," NONE, sizeof(buf1));
 		if (iscsi_update_param_value(param, buf1) < 0)
 			return -EINVAL;
 	}
Signature · 1 line
2.17.1