diff --git a/src/object/cli_obj.c b/src/object/cli_obj.c index a93f84bc4587..a7f8eccac8a5 100644 --- a/src/object/cli_obj.c +++ b/src/object/cli_obj.c @@ -2216,6 +2216,18 @@ obj_iod_sgl_valid(daos_obj_id_t oid, unsigned int nr, daos_iod_t *iods, return -DER_INVAL; } } + if (sgls != NULL && sgls[i].sg_nr > 0) { + d_sg_list_t *sg = &sgls[i]; + d_iov_t *iov; + + for (j = 0; j < sg->sg_nr; j++) { + iov = sg->sg_iovs + j; + if (iov == NULL || (iov->iov_buf_len > 0 && iov->iov_buf == NULL)) { + D_ERROR("Bad iov\n"); + return -DER_INVAL; + } + } + } switch (iods[i].iod_type) { default: