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:
@@ -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 +
|
||||
|
||||
Reference in New Issue
Block a user