diff options
| author | Michael Brown | 2012-05-16 11:50:56 +0200 |
|---|---|---|
| committer | Michael Brown | 2012-05-16 11:55:58 +0200 |
| commit | 73b21174b228add00e49de2a01b94a2fbaa8b130 (patch) | |
| tree | e692a9f12c04e5d94039e622f5d3afcdf0b41ae3 /src | |
| parent | [test] Add self-tests for OCSP (diff) | |
| download | ipxe-73b21174b228add00e49de2a01b94a2fbaa8b130.tar.gz ipxe-73b21174b228add00e49de2a01b94a2fbaa8b130.tar.xz ipxe-73b21174b228add00e49de2a01b94a2fbaa8b130.zip | |
[iscsi] Report SCSI response only when applicable
iSCSI generally includes a full SCSI response only when an error
occurs. iscsi_scsi_done() currently passes the NULL response through
to scsi_response(), which ends up causing scsicmd_response() to
dereference a NULL pointer.
Fix by calling scsi_response() only if we have a non-NULL response.
Reported-by: Brendon Walsh <brendonwalsh@niamu.com>
Tested-by: Brendon Walsh <brendonwalsh@niamu.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/net/tcp/iscsi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c index 9eaf3cc50..457ea7314 100644 --- a/src/net/tcp/iscsi.c +++ b/src/net/tcp/iscsi.c @@ -337,7 +337,8 @@ static void iscsi_scsi_done ( struct iscsi_session *iscsi, int rc, iscsi->command = NULL; /* Send SCSI response, if any */ - scsi_response ( &iscsi->data, rsp ); + if ( rsp ) + scsi_response ( &iscsi->data, rsp ); /* Close SCSI command, if this is still the same command. (It * is possible that the command interface has already been |
