KEYS: encrypted: Add check for strsep

Add check for strsep() in order to transfer the error.

Fixes: cd3bc044af ("KEYS: encrypted: Instantiate key with user-provided decrypted data")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
Chen Ni 2023-11-08 07:36:27 +00:00 committed by Mimi Zohar
parent f17167bea2
commit b4af096b5d

View File

@ -237,6 +237,10 @@ static int datablob_parse(char *datablob, const char **format,
break;
}
*decrypted_data = strsep(&datablob, " \t");
if (!*decrypted_data) {
pr_info("encrypted_key: decrypted_data is missing\n");
break;
}
ret = 0;
break;
case Opt_load: