Fail gracefully if name is NULL in crypt_init_by_name() & co

This commit is contained in:
Ondrej Kozina
2017-08-25 12:44:49 +02:00
committed by Milan Broz
parent b27507790f
commit a6106117a9

View File

@@ -1121,6 +1121,9 @@ int crypt_init_by_name_and_header(struct crypt_device **cd,
struct crypt_dm_active_device dmd; struct crypt_dm_active_device dmd;
int r; int r;
if (!name)
return -EINVAL;
log_dbg("Allocating crypt device context by device %s.", name); log_dbg("Allocating crypt device context by device %s.", name);
ci = crypt_status(NULL, name); ci = crypt_status(NULL, name);