Skip to content

Commit

Permalink
DAOS-15276 object: refine sgl valid check
Browse files Browse the repository at this point in the history
Required-githooks: true

Signed-off-by: Xuezhao Liu <[email protected]>
  • Loading branch information
liuxuezhao committed Apr 17, 2024
1 parent c555ef0 commit ab39069
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/object/cli_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ab39069

Please sign in to comment.