test-tool: Avoid crashes due to NULL-pointer dereferences

Avoid that certain test failures cause the test tool to trigger a
segmentation fault.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
This commit is contained in:
Bart Van Assche
2017-10-30 16:58:09 -07:00
parent 8f2abea4de
commit 4d1918859f
3 changed files with 17 additions and 2 deletions
@@ -69,6 +69,10 @@ test_extendedcopy_descr_limits(void)
RECEIVE_COPY_RESULTS(&edl_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0,
(void **)&opp, EXPECT_STATUS_GOOD);
CU_ASSERT_NOT_EQUAL(opp, NULL);
if (!opp)
return;
/* Allocate buffer to accommodate (MAX+1) target and
* segment descriptors */
alloc_len = XCOPY_DESC_OFFSET +