Commit 4120d975 authored by Jorge Ramirez-Ortiz's avatar Jorge Ramirez-Ortiz Committed by Philippe Gerum

lib/analogy: validate size of calibration file

Signed-off-by: default avatarJorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
parent 69ab2204
......@@ -200,10 +200,14 @@ int a4l_read_calibration_file(char *name, struct a4l_calibration_data *data)
int i, j, k, index = -1, nb_elements = -1;
struct a4l_calibration_subdev_data *p = NULL;
struct _dictionary_ *d;
struct stat st;
if (access(name, R_OK))
return -1;
if (stat(name, &st) || !st.st_size)
return -1;
d = iniparser_load(name);
if (d == NULL)
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment