[PATCH 3.16 019/328] scsi: target/iscsi: Make iscsit_ta_authentication() respect the output buffer size

From
Ben Hutchings <hidden>
Date
2018-12-09 22:28:47
Also in
lkml
Reply to
Ben Hutchings, 2018-12-09
3.16.62-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Bart Van Assche <redacted>

commit 35bea5c84fd13c643cce63f0b5cd4b148f8c901d upstream.

Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Signed-off-by: Bart Van Assche <redacted>
Reviewed-by: Mike Christie <redacted>
Cc: Mike Christie <redacted>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <redacted>
Signed-off-by: Ben Hutchings <redacted>
---
 drivers/target/iscsi/iscsi_target_tpg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -652,8 +652,7 @@ int iscsit_ta_authentication(struct iscs
 		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;
 	}
Thread (338 messages) 338 messages, 5 authors, last reply 2018-12-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help