Commit 11e67d93 authored by John Levon's avatar John Levon Committed by Tomasz Zawadzki
Browse files

lib/nvmf: sanity check req->iovcnt



If req->data is set, with all the previous changes, then req->iovcnt
should also be more than zero.

Signed-off-by: default avatarJohn Levon <john.levon@nutanix.com>
Change-Id: I29b5f45541c9dba2dd896109dd43d2b5321ec467
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16274


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 70a82d9a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4498,6 +4498,10 @@ spdk_nvmf_request_exec(struct spdk_nvmf_request *req)
	struct spdk_nvmf_transport *transport = qpair->transport;
	enum spdk_nvmf_request_exec_status status;

	if (req->data != NULL) {
		assert(req->iovcnt > 0);
	}

	if (!nvmf_check_subsystem_active(req)) {
		return;
	}