cryptsetup: check that password is not null

Beef up the assert to protect against passing null to strlen.

Found with scan-build.
This commit is contained in:
Thomas Hindoe Paaboel Andersen 2014-06-12 22:50:04 +02:00
parent f8b5d99408
commit f268f57f63

View file

@ -344,7 +344,7 @@ static int attach_tcrypt(struct crypt_device *cd,
assert(cd);
assert(name);
assert(key_file || passwords);
assert(key_file || (passwords && passwords[0]));
if (arg_tcrypt_hidden)
params.flags |= CRYPT_TCRYPT_HIDDEN_HEADER;