mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 15:10:33 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user