summaryrefslogtreecommitdiff
path: root/security/keys
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2023-11-08 07:36:27 +0000
committerMimi Zohar <zohar@linux.ibm.com>2023-11-27 12:44:47 -0500
commitb4af096b5df5dd131ab796c79cedc7069d8f4882 (patch)
tree6350122a39320e40990090516aa35904caa17f95 /security/keys
parentf17167bea279d07314ee2629e7ce2dd5a754fec7 (diff)
KEYS: encrypted: Add check for strsep
Add check for strsep() in order to transfer the error. Fixes: cd3bc044af48 ("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>
Diffstat (limited to 'security/keys')
-rw-r--r--security/keys/encrypted-keys/encrypted.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index 8af2136069d2..76f55dd13cb8 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -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: