scsi: target/iscsi: Make iscsit_ta_authentication() respect the output buffer size
authorBart Van Assche <bart.vanassche@wdc.com>
Fri, 22 Jun 2018 21:53:01 +0000 (14:53 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 2 Jul 2018 20:44:31 +0000 (16:44 -0400)
Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/iscsi/iscsi_target_tpg.c

index 4b34f71547c689e21a98530c8eb1417b0de20cc7..101d62105c9325d939ff86aa20091266dea15827 100644 (file)
@@ -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;
        }