mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Fix NULL key_description bug in luks2-keyring token.
json-c parser transforms NULL pointer into special '(null)' string. While being technically correct it hides the fact user passed NULL pointer in crypt_token_params_luks2_keyring structure. This bug could be trigerred by calling crypt_token_luks2_keyring_set().
This commit is contained in:
@@ -5931,7 +5931,7 @@ int crypt_token_luks2_keyring_set(struct crypt_device *cd,
|
||||
int r;
|
||||
char json[4096];
|
||||
|
||||
if (!params)
|
||||
if (!params || !params->key_description)
|
||||
return -EINVAL;
|
||||
|
||||
log_dbg(cd, "Creating new LUKS2 keyring token (%d).", token);
|
||||
|
||||
Reference in New Issue
Block a user