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>
Esse commit está contido em:
Dmitry Kasatkin
2014-11-26 16:55:00 +02:00
commit de Mimi Zohar
commit 9d03a721a3
3 arquivos alterados com 5 adições e 2 exclusões

Ver arquivo

@@ -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);