Commit b4af096b authored by Chen Ni's avatar Chen Ni Committed by Mimi Zohar

KEYS: encrypted: Add check for strsep

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

Fixes: cd3bc044 ("KEYS: encrypted: Instantiate key with user-provided decrypted data")
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent f17167be
...@@ -237,6 +237,10 @@ static int datablob_parse(char *datablob, const char **format, ...@@ -237,6 +237,10 @@ static int datablob_parse(char *datablob, const char **format,
break; break;
} }
*decrypted_data = strsep(&datablob, " \t"); *decrypted_data = strsep(&datablob, " \t");
if (!*decrypted_data) {
pr_info("encrypted_key: decrypted_data is missing\n");
break;
}
ret = 0; ret = 0;
break; break;
case Opt_load: case Opt_load:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment