summaryrefslogtreecommitdiff
path: root/src/cryptsetup/cryptsetup.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-06-12 22:50:04 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-06-13 00:30:40 +0200
commitf268f57f6344d3a2ccf447352ff3ed1313c4a199 (patch)
tree37edf8f2694dcaad7e1e4187ac90357353e36465 /src/cryptsetup/cryptsetup.c
parentf8b5d99408e016ecb3d9bcffcee8c65ef6bc26f6 (diff)
cryptsetup: check that password is not null
Beef up the assert to protect against passing null to strlen. Found with scan-build.
Diffstat (limited to 'src/cryptsetup/cryptsetup.c')
-rw-r--r--src/cryptsetup/cryptsetup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 812b32f6ca..a67d85e623 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -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;