diff options
author | Dmitry Kasatkin <d.kasatkin@samsung.com> | 2014-11-26 15:55:00 +0100 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2015-05-21 19:59:28 +0200 |
commit | 9d03a721a3a4a5120de790a0e67dc324c2ed9184 (patch) | |
tree | 0ad52d2f7800e0c5f78c121ec5d5b24e33f7c954 /security/integrity/iint.c | |
parent | KEYS: fix "ca_keys=" partial key matching (diff) | |
download | linux-9d03a721a3a4a5120de790a0e67dc324c2ed9184.tar.xz linux-9d03a721a3a4a5120de790a0e67dc324c2ed9184.zip |
integrity: add validity checks for 'path' parameter
This patch adds validity checks for 'path' parameter and
makes it const.
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity/iint.c')
-rw-r--r-- | security/integrity/iint.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/security/integrity/iint.c b/security/integrity/iint.c index dbb6d141c3db..3d2f5b45c8cb 100644 --- a/security/integrity/iint.c +++ b/security/integrity/iint.c @@ -213,6 +213,9 @@ int __init integrity_read_file(const char *path, char **data) char *buf; int rc = -EINVAL; + if (!path || !*path) + return -EINVAL; + file = filp_open(path, O_RDONLY, 0); if (IS_ERR(file)) { rc = PTR_ERR(file); |