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:
@@ -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);
|
||||
|
Referência em uma nova issue
Block a user