Skip to content

Commit

Permalink
KEYS: encrypted: Add check for strsep
Browse files Browse the repository at this point in the history
Add check for strsep() in order to transfer the error.

Fixes: cd3bc04 ("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>
  • Loading branch information
Chen Ni authored and Mimi Zohar committed Nov 27, 2023
1 parent f17167b commit b4af096
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions security/keys/encrypted-keys/encrypted.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b4af096

Please sign in to comment.