Skip to content

Commit b4af096

Browse files
Chen Nimimizohar
authored andcommitted
KEYS: encrypted: Add check for strsep
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>
1 parent f17167b commit b4af096

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

security/keys/encrypted-keys/encrypted.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ static int datablob_parse(char *datablob, const char **format,
237237
break;
238238
}
239239
*decrypted_data = strsep(&datablob, " \t");
240+
if (!*decrypted_data) {
241+
pr_info("encrypted_key: decrypted_data is missing\n");
242+
break;
243+
}
240244
ret = 0;
241245
break;
242246
case Opt_load:

0 commit comments

Comments
 (0)