diff --git a/src/nvme/linux.c b/src/nvme/linux.c index 074c27e0..f0723193 100644 --- a/src/nvme/linux.c +++ b/src/nvme/linux.c @@ -1104,6 +1104,11 @@ static size_t nvme_identity_len(int hmac, int version, const char *hostnqn, { size_t len; + if (!hostnqn || !subsysnqn) { + errno = EINVAL; + return -1; + } + len = strlen(hostnqn) + strlen(subsysnqn) + 12; if (version == 1) { len += 66;