Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68edbce4 authored by Joern Engel's avatar Joern Engel Committed by Nicholas Bellinger
Browse files

target: fix pr_out length in iscsi_parse_pr_out_transport_id



Old code in iscsi_parse_pr_out_transport_id() was obviously buggy
and effectively ignored the high byte.

Found by coverity.

Signed-off-by: default avatarJoern Engel <joern@logfs.org>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 1481473b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -394,9 +394,9 @@ char *iscsi_parse_pr_out_transport_id(
	 * If the caller wants the TransportID Length, we set that value for the
	 * entire iSCSI Tarnsport ID now.
	 */
	 if (out_tid_len != NULL) {
		add_len = ((buf[2] >> 8) & 0xff);
		add_len |= (buf[3] & 0xff);
	if (out_tid_len) {
		/* The shift works thanks to integer promotion rules */
		add_len = (buf[2] << 8) | buf[3];

		tid_len = strlen(&buf[4]);
		tid_len += 4; /* Add four bytes for iSCSI Transport ID header */